diff --git a/packages/eas-cli/src/commands/env/exec.ts b/packages/eas-cli/src/commands/env/exec.ts index 227e340c13..6798b7ca2f 100644 --- a/packages/eas-cli/src/commands/env/exec.ts +++ b/packages/eas-cli/src/commands/env/exec.ts @@ -96,10 +96,19 @@ export default class EnvExec extends EasCommand { throw new Error("Invalid environment. Use one of 'production', 'preview', or 'development'."); } + let cleanCommand = bash_command; + if (bash_command) { + const firstChar = bash_command[0]; + const lastChar = bash_command[bash_command.length - 1]; + if ((firstChar === '"' && lastChar === '"') || (firstChar === "'" && lastChar === "'")) { + cleanCommand = bash_command.slice(1, -1); + } + } + return { nonInteractive: rawFlags['non-interactive'], environment, - command: bash_command, + command: cleanCommand, }; } @@ -111,7 +120,8 @@ export default class EnvExec extends EasCommand { environmentVariables: Record; }): Promise { Log.log(`Running command: ${chalk.bold(command)}`); - const spawnPromise = spawnAsync('bash', ['-c', command], { + const spawnPromise = spawnAsync(command, [], { + shell: true, stdio: ['inherit', 'pipe', 'pipe'], env: { ...process.env,