Skip to content

Commit

Permalink
[eas-cli] Enhance eas env:exec command by enabling shell execution …
Browse files Browse the repository at this point in the history
…for commands

* This change allows for better command handling and execution within the environment context.
* Fix command execution in env:exec to handle various command formats properly.
  • Loading branch information
tharakadesilva committed Dec 21, 2024
1 parent a1d086f commit 7a83891
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/eas-cli/src/commands/env/exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ export default class EnvExec extends EasCommand {
environmentVariables: Record<string, string>;
}): Promise<void> {
Log.log(`Running command: ${chalk.bold(command)}`);
const spawnPromise = spawnAsync('bash', ['-c', command], {
const escapedCommand = command.replace(/'/g, "'\\''");
const spawnPromise = spawnAsync('bash', ['-c', `'${escapedCommand}'`], {
shell: true,
stdio: ['inherit', 'pipe', 'pipe'],
env: {
...process.env,
Expand Down

0 comments on commit 7a83891

Please sign in to comment.