mirror of
https://github.com/actions/runner.git
synced 2025-12-11 12:57:05 +00:00
set default shell to powershell in windows (#135)
* set default shell to powershell in windows * Update error checking * Update error message
This commit is contained in:
@@ -60,10 +60,10 @@ namespace GitHub.Runner.Worker.Handlers
|
||||
if (string.IsNullOrEmpty(shell))
|
||||
{
|
||||
#if OS_WINDOWS
|
||||
shellCommand = "cmd";
|
||||
shellCommand = "powershell";
|
||||
if(validateShellOnHost)
|
||||
{
|
||||
shellCommandPath = System.Environment.GetEnvironmentVariable("ComSpec");
|
||||
shellCommandPath = WhichUtil.Which(shellCommand, true, Trace);
|
||||
}
|
||||
#else
|
||||
shellCommand = "sh";
|
||||
@@ -143,9 +143,9 @@ namespace GitHub.Runner.Worker.Handlers
|
||||
if (string.IsNullOrEmpty(shell))
|
||||
{
|
||||
#if OS_WINDOWS
|
||||
shellCommand = "cmd";
|
||||
commandPath = System.Environment.GetEnvironmentVariable("ComSpec");
|
||||
ArgUtil.NotNullOrEmpty(commandPath, "%ComSpec%");
|
||||
shellCommand = "powershell";
|
||||
commandPath = WhichUtil.Which(shellCommand, true, Trace);
|
||||
ArgUtil.NotNullOrEmpty(commandPath, "Default Shell");
|
||||
#else
|
||||
shellCommand = "sh";
|
||||
commandPath = WhichUtil.Which("bash", false, Trace) ?? WhichUtil.Which("sh", true, Trace);
|
||||
|
||||
Reference in New Issue
Block a user