mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-09-23 15:34:37 +00:00
escape arguments for bash
This commit is contained in:
@@ -19,7 +19,8 @@ namespace ElectronNET.CLI
|
||||
else
|
||||
{
|
||||
// works for OSX and Linux (at least on Ubuntu)
|
||||
cmd.StartInfo = new ProcessStartInfo("bash", "-c " + command);
|
||||
var escapedArgs = command.Replace("\"", "\\\"");
|
||||
cmd.StartInfo = new ProcessStartInfo("bash", $"-c \"{escapedArgs}\"");
|
||||
}
|
||||
|
||||
cmd.StartInfo.RedirectStandardInput = true;
|
||||
|
||||
Reference in New Issue
Block a user