mirror of
https://github.com/actions/runner.git
synced 2025-12-13 10:05:23 +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 (string.IsNullOrEmpty(shell))
|
||||||
{
|
{
|
||||||
#if OS_WINDOWS
|
#if OS_WINDOWS
|
||||||
shellCommand = "cmd";
|
shellCommand = "powershell";
|
||||||
if(validateShellOnHost)
|
if(validateShellOnHost)
|
||||||
{
|
{
|
||||||
shellCommandPath = System.Environment.GetEnvironmentVariable("ComSpec");
|
shellCommandPath = WhichUtil.Which(shellCommand, true, Trace);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
shellCommand = "sh";
|
shellCommand = "sh";
|
||||||
@@ -143,9 +143,9 @@ namespace GitHub.Runner.Worker.Handlers
|
|||||||
if (string.IsNullOrEmpty(shell))
|
if (string.IsNullOrEmpty(shell))
|
||||||
{
|
{
|
||||||
#if OS_WINDOWS
|
#if OS_WINDOWS
|
||||||
shellCommand = "cmd";
|
shellCommand = "powershell";
|
||||||
commandPath = System.Environment.GetEnvironmentVariable("ComSpec");
|
commandPath = WhichUtil.Which(shellCommand, true, Trace);
|
||||||
ArgUtil.NotNullOrEmpty(commandPath, "%ComSpec%");
|
ArgUtil.NotNullOrEmpty(commandPath, "Default Shell");
|
||||||
#else
|
#else
|
||||||
shellCommand = "sh";
|
shellCommand = "sh";
|
||||||
commandPath = WhichUtil.Which("bash", false, Trace) ?? WhichUtil.Which("sh", true, Trace);
|
commandPath = WhichUtil.Which("bash", false, Trace) ?? WhichUtil.Which("sh", true, Trace);
|
||||||
|
|||||||
Reference in New Issue
Block a user