Skip to content

Commit

Permalink
fix: check oclif exit code first (#466)
Browse files Browse the repository at this point in the history
* fix: check oclif exit code first

* ci: rm cli-plugins-testkit for external nuts
  • Loading branch information
mdonnalley committed Dec 14, 2023
1 parent 1a07a01 commit 6ac36aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
packageName: '@salesforce/sf-plugins-core'
externalProjectGitUrl: 'https://github.com/salesforcecli/plugin-deploy-retrieve'
preBuildCommands: 'shx rm -rf node_modules/@oclif/core; shx rm -rf node_modules/@salesforce/kit; shx rm -rf node_modules/@salesforce/core; shx rm -rf node_modules/@salesforce/ts-types'
preBuildCommands: 'shx rm -rf node_modules/@oclif/core; shx rm -rf node_modules/@salesforce/kit; shx rm -rf node_modules/@salesforce/core; shx rm -rf node_modules/@salesforce/ts-types; shx rm -rf node_modules/@salesforce/cli-plugins-testkit'
command: ${{ matrix.command }}
os: ${{ matrix.os }}
secrets: inherit
Expand Down
2 changes: 1 addition & 1 deletion src/sfCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ export abstract class SfCommand<T> extends Command {

// @ts-expect-error because exitCode is not on Error
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
const codeFromError = (error.exitCode as number | undefined) ?? (error.oclif?.exit as number | undefined) ?? 1;
const codeFromError = (error.oclif?.exit as number | undefined) ?? (error.exitCode as number | undefined) ?? 1;
process.exitCode ??= codeFromError;

const sfErrorProperties = removeEmpty({
Expand Down

0 comments on commit 6ac36aa

Please sign in to comment.