Skip to content

Commit 7f83733

Browse files
committed
Don't assume the working directory exists.
1 parent 29f67ca commit 7f83733

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/GitVersionCore/Helpers/ProcessHelper.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,18 @@ public static int Run(Action<string> output, Action<string> errorOutput, TextRea
5050
{
5151
if (String.IsNullOrEmpty(exe))
5252
throw new ArgumentNullException("exe");
53+
5354
if (output == null)
5455
throw new ArgumentNullException("output");
5556

5657
workingDirectory = workingDirectory ?? Environment.CurrentDirectory;
5758

59+
if (!Directory.Exists(workingDirectory))
60+
{
61+
errorOutput(string.Format("The directory {0} doesn't exist.", workingDirectory));
62+
return 1;
63+
}
64+
5865
var psi = new ProcessStartInfo
5966
{
6067
UseShellExecute = false,

0 commit comments

Comments
 (0)