diff --git a/js/index.d.ts b/js/index.d.ts index c797ba81ff..360085668c 100644 --- a/js/index.d.ts +++ b/js/index.d.ts @@ -217,7 +217,7 @@ declare module '@sentry/cli' { newDeploy(release: string, options: SentryCliNewDeployOptions): Promise; - execute(args: string[], live: boolean): Promise; + execute(args: string[], live: boolean | 'rejectOnError'): Promise; } export default class SentryCli { @@ -237,6 +237,6 @@ declare module '@sentry/cli' { public static getVersion(): string; public static getPath(): string; - public execute(args: string[], live: boolean): Promise; + public execute(args: string[], live: boolean | 'rejectOnError'): Promise; } } diff --git a/js/index.js b/js/index.js index 07b0180de5..fd70b0f0c3 100644 --- a/js/index.js +++ b/js/index.js @@ -57,7 +57,11 @@ class SentryCli { /** * See {helper.execute} docs. * @param {string[]} args Command line arguments passed to `sentry-cli`. - * @param {boolean} live We inherit stdio to display `sentry-cli` output directly. + * @param {boolean | 'rejectOnError'} live can be set to: + * - `true` to inherit stdio to display `sentry-cli` output directly. + * - `false` to not inherit stdio and return the output as a string. + * - `'rejectOnError'` to inherit stdio and reject the promise if the command + * exits with a non-zero exit code. * @returns {Promise.} A promise that resolves to the standard output. */ execute(args, live) {