Skip to content
This repository was archived by the owner on Jun 22, 2021. It is now read-only.

Commit e7218d8

Browse files
committed
ignore bash errors
1 parent 8b96671 commit e7218d8

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

DevActivator.Meetups.BL/Helpers/ShellHelper.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using System.Diagnostics;
23

34
namespace DevActivator.Meetups.BL.Helpers
@@ -21,9 +22,17 @@ public static string Bash(this string command)
2122
}
2223
};
2324

24-
process.Start();
25-
var result = process.StandardOutput.ReadToEnd();
26-
process.WaitForExit();
25+
string result;
26+
try
27+
{
28+
process.Start();
29+
result = process.StandardOutput.ReadToEnd();
30+
process.WaitForExit();
31+
}
32+
catch (Exception _)
33+
{
34+
result = "bash error";
35+
}
2736

2837
return result.TrimEnd('\r', '\n');
2938
}

0 commit comments

Comments
 (0)