Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add another RunProject function with args to script. #6

Merged
merged 1 commit into from
Apr 16, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}
}
}