Skip to content

Commit

Permalink
rebase and add to non-interactive
Browse files Browse the repository at this point in the history
  • Loading branch information
wschurman committed Jan 10, 2025
1 parent f4a65e3 commit 0c6631b
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions packages/eas-cli/src/commands/env/exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,26 @@ export default class EnvExec extends EasCommand {
};
}

// eslint-disable-next-line async-protect/async-suffix
protected override async catch(err: Error): Promise<any> {
// when in non-interactive, make the behavior of this command a pure passthrough, outputting only the subprocess' stdout and stderr and exiting with the
// sub-command's exit status
if (this.isNonInteractive) {
process.exitCode = process.exitCode ?? (err as any).status ?? 1;
} else {
await super.catch(err);
}
}

private async runCommandNonInteractiveWithEnvVarsAsync({
command,
environmentVariables,
}: {
command: string;
environmentVariables: Record<string, string>;
}): Promise<void> {
await spawnAsync('bash', ['-c', command], {
await spawnAsync(command, [], {
shell: true,
stdio: 'inherit',
env: {
...process.env,
Expand All @@ -137,17 +149,6 @@ export default class EnvExec extends EasCommand {
});
}

// eslint-disable-next-line async-protect/async-suffix
protected override async catch(err: Error): Promise<any> {
// when in non-interactive, make the behavior of this command a pure passthrough, outputting only the subprocess' stdout and stderr and exiting with the
// sub-command's exit status
if (this.isNonInteractive) {
process.exitCode = process.exitCode ?? (err as any).status ?? 1;
} else {
await super.catch(err);
}
}

private async runCommandWithEnvVarsAsync({
command,
environmentVariables,
Expand Down

0 comments on commit 0c6631b

Please sign in to comment.