add filename param to ShellRun command for running other shell types

This commit is contained in:
Jeremy 2021-11-18 05:56:51 +11:00
parent 3e38a9035c
commit ef56d91c2f
2 changed files with 3 additions and 3 deletions

View file

@ -35,7 +35,7 @@ namespace Flow.Launcher.Plugin
/// <param name="cmd">The command or program to run</param>
/// <exception cref="FileNotFoundException">Thrown when unable to find the file specified in the command </exception>
/// <exception cref="Win32Exception">Thrown when error occurs during the execution of the command </exception>
void ShellRun(string cmd);
void ShellRun(string cmd, string filename = "cmd.exe");
/// <summary>
/// Save everything, all of Flow Launcher and plugins' data and settings

View file

@ -107,9 +107,9 @@ namespace Flow.Launcher
});
}
public void ShellRun(string cmd)
public void ShellRun(string cmd, string filename = "cmd.exe")
{
var startInfo = ShellCommand.SetProcessStartInfo("cmd.exe", arguments: $"/C {cmd}", createNoWindow: true);
var startInfo = ShellCommand.SetProcessStartInfo(filename, arguments: $"/C {cmd}", createNoWindow: true);
ShellCommand.Execute(startInfo);
}