Skip to content

Commit

Permalink
Merge pull request #6 from idrilsilverfoot/master
Browse files Browse the repository at this point in the history
Add another RunProject function with args to script.
  • Loading branch information
christianrondeau committed Apr 16, 2016
2 parents dbb84a0 + 9be8e34 commit 319c991
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion SikuliSharp/Sikuli.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,21 @@ public static string RunProject(string projectPath)
return output;
}
}
}

public static string RunProject(string projectPath, string args)
{
if (projectPath == null) throw new ArgumentNullException("projectPath");

if (!Directory.Exists(projectPath))
throw new DirectoryNotFoundException(string.Format("Project not found in path '{0}'", projectPath));

var processFactory = new SikuliScriptProcessFactory();
using (var process = processFactory.Start(string.Format("-r {0} {1}", projectPath, args)))
{
var output = process.StandardOutput.ReadToEnd();
process.WaitForExit();
return output;
}
}
}
}

0 comments on commit 319c991

Please sign in to comment.