Skip to content

Commit 15e716a

Browse files
committed
rebase and add to non-interactive
1 parent f4a65e3 commit 15e716a

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

Diff for: CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ This is the log of notable changes to EAS CLI and related packages.
1010

1111
### 🐛 Bug fixes
1212

13+
- Enable shell execution for env:exec commands. ([#2788](https://github.com/expo/eas-cli/pull/2788) by [@tharakadesilva](https://github.com/tharakadesilva))
14+
1315
### 🧹 Chores
1416

1517
- Make automatic env resolution message shorter. ([#2806](https://github.com/expo/eas-cli/pull/2806) by [@szdziedzic](https://github.com/szdziedzic))

Diff for: packages/eas-cli/src/commands/env/exec.ts

+13-12
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,26 @@ export default class EnvExec extends EasCommand {
121121
};
122122
}
123123

124+
// eslint-disable-next-line async-protect/async-suffix
125+
protected override async catch(err: Error): Promise<any> {
126+
// when in non-interactive, make the behavior of this command a pure passthrough, outputting only the subprocess' stdout and stderr and exiting with the
127+
// sub-command's exit status
128+
if (this.isNonInteractive) {
129+
process.exitCode = process.exitCode ?? (err as any).status ?? 1;
130+
} else {
131+
await super.catch(err);
132+
}
133+
}
134+
124135
private async runCommandNonInteractiveWithEnvVarsAsync({
125136
command,
126137
environmentVariables,
127138
}: {
128139
command: string;
129140
environmentVariables: Record<string, string>;
130141
}): Promise<void> {
131-
await spawnAsync('bash', ['-c', command], {
142+
await spawnAsync(command, [], {
143+
shell: true,
132144
stdio: 'inherit',
133145
env: {
134146
...process.env,
@@ -137,17 +149,6 @@ export default class EnvExec extends EasCommand {
137149
});
138150
}
139151

140-
// eslint-disable-next-line async-protect/async-suffix
141-
protected override async catch(err: Error): Promise<any> {
142-
// when in non-interactive, make the behavior of this command a pure passthrough, outputting only the subprocess' stdout and stderr and exiting with the
143-
// sub-command's exit status
144-
if (this.isNonInteractive) {
145-
process.exitCode = process.exitCode ?? (err as any).status ?? 1;
146-
} else {
147-
await super.catch(err);
148-
}
149-
}
150-
151152
private async runCommandWithEnvVarsAsync({
152153
command,
153154
environmentVariables,

0 commit comments

Comments
 (0)