Skip to content

Commit

Permalink
Add bash for non-windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Duplenskikh committed Oct 6, 2023
1 parent 53c2f64 commit 00d2d0f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Agent.Worker/JobExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ public async Task<List<IStep>> InitializeJob(IExecutionContext jobContext, Pipel
if (AgentKnobs.ForceAZCLIToolDowngradeTo252.GetValue(jobContext).AsBoolean())
{
context.Output("Temporary step with AZ CLI downgrading.");
string powershell = WhichUtil.Which("powershell", require: true, trace: Trace);
string powershell = WhichUtil.Which("powershell", trace: Trace);
string bash = WhichUtil.Which("bash", trace: Trace);
var downgradeAZCLIScript = GenerateAZCLIDowngradeScript();

using (var processInvoker = HostContext.CreateService<IProcessInvoker>())
Expand Down Expand Up @@ -282,7 +283,7 @@ public async Task<List<IStep>> InitializeJob(IExecutionContext jobContext, Pipel

var exitCode = await processInvoker.ExecuteAsync(
workingDirectory: string.Empty,
fileName: powershell,
fileName: PlatformUtil.RunningOnWindows ? powershell : bash,
arguments: "az --version",
environment: null,
cancellationToken: CancellationToken.None);
Expand Down

0 comments on commit 00d2d0f

Please sign in to comment.