From 0f9b56e0d739c5f1e411949ff815bc61a0a4b410 Mon Sep 17 00:00:00 2001 From: Sanjula Ganepola Date: Tue, 26 Nov 2024 22:11:21 -0500 Subject: [PATCH 1/2] Use hardcoded shells for act commands Signed-off-by: Sanjula Ganepola --- src/act.ts | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/act.ts b/src/act.ts index 421e0b8..a353fb4 100644 --- a/src/act.ts +++ b/src/act.ts @@ -190,19 +190,6 @@ export class Act { return ConfigurationManager.get(Section.actCommand) || Act.command; } - private getShell() { - switch (process.platform) { - case Platform.windows: - return 'cmd'; - case Platform.mac: - return 'zsh'; - case Platform.linux: - return 'bash'; - default: - return env.shell; - } - } - async runAllWorkflows(workspaceFolder: WorkspaceFolder) { return await this.runCommand({ path: workspaceFolder.uri.fsPath, @@ -375,11 +362,24 @@ export class Act { } } + let shell = env.shell; + switch (process.platform) { + case Platform.windows: + shell = 'cmd'; + break; + case Platform.mac: + shell = 'zsh'; + break; + case Platform.linux: + shell = 'bash'; + break; + } + const exec = childProcess.spawn( command, { cwd: commandArgs.path, - shell: this.getShell(), + shell: shell, env: { ...process.env, ...settings.secrets @@ -470,7 +470,7 @@ export class Act { problemMatchers: [], runOptions: {}, group: TaskGroup.Build, - execution: new ShellExecution(command, { executable: this.getShell() }) + execution: new ShellExecution(command) }); } } From fbd551adea57434a473ec7399d88213cc77a86dd Mon Sep 17 00:00:00 2001 From: Sanjula Ganepola Date: Tue, 26 Nov 2024 22:11:45 -0500 Subject: [PATCH 2/2] fix gh command Signed-off-by: Sanjula Ganepola --- src/act.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/act.ts b/src/act.ts index a353fb4..0e6f989 100644 --- a/src/act.ts +++ b/src/act.ts @@ -100,7 +100,7 @@ export class Act { 'Chocolatey': 'choco install act-cli', 'Winget': 'winget install nektos.act', 'Scoop': 'scoop install act', - 'GitHub CLI': 'gh auth status || gh auth login && gh extension install https://github.com/nektos/gh-act' + 'GitHub CLI': '(gh auth status || gh auth login) && gh extension install https://github.com/nektos/gh-act' }; this.prebuiltExecutables = { @@ -115,7 +115,7 @@ export class Act { 'Homebrew': 'brew install act', 'Nix': 'nix run nixpkgs#act', 'MacPorts': 'sudo port install act', - 'GitHub CLI': 'gh auth status || gh auth login && gh extension install https://github.com/nektos/gh-act' + 'GitHub CLI': '(gh auth status || gh auth login) && gh extension install https://github.com/nektos/gh-act' }; this.prebuiltExecutables = { @@ -129,7 +129,7 @@ export class Act { 'Nix': 'nix run nixpkgs#act', 'AUR': 'yay -Syu act', 'COPR': 'dnf copr enable goncalossilva/act && dnf install act-cli', - 'GitHub CLI': 'gh auth status || gh auth login && gh extension install https://github.com/nektos/gh-act' + 'GitHub CLI': '(gh auth status || gh auth login) && gh extension install https://github.com/nektos/gh-act' }; this.prebuiltExecutables = {