Skip to content

fix: show commands output #1109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ EXAMPLES
$ sfdx channel promote --candidate latest-rc --target latest --platform win --platform mac
```

_See code: [src/commands/channel/promote.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.7/src/commands/channel/promote.ts)_
_See code: [src/commands/channel/promote.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.8-dev.2/src/commands/channel/promote.ts)_

## `sfdx cli artifacts compare`

Expand All @@ -169,7 +169,7 @@ EXAMPLES
$ sfdx cli artifacts compare
```

_See code: [src/commands/cli/artifacts/compare.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.7/src/commands/cli/artifacts/compare.ts)_
_See code: [src/commands/cli/artifacts/compare.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.8-dev.2/src/commands/cli/artifacts/compare.ts)_

## `sfdx cli install jit test`

Expand All @@ -190,7 +190,7 @@ EXAMPLES
$ sfdx cli install jit test
```

_See code: [src/commands/cli/install/jit/test.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.7/src/commands/cli/install/jit/test.ts)_
_See code: [src/commands/cli/install/jit/test.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.8-dev.2/src/commands/cli/install/jit/test.ts)_

## `sfdx cli install test`

Expand Down Expand Up @@ -231,7 +231,7 @@ EXAMPLES
$ sfdx cli install test --cli sf --method tarball --channel stable-rc
```

_See code: [src/commands/cli/install/test.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.7/src/commands/cli/install/test.ts)_
_See code: [src/commands/cli/install/test.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.8-dev.2/src/commands/cli/install/test.ts)_

## `sfdx cli release automerge`

Expand Down Expand Up @@ -262,7 +262,7 @@ EXAMPLES
$ sfdx cli release automerge --owner salesforcecli --repo sfdx-cli --pul-number 1049
```

_See code: [src/commands/cli/release/automerge.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.7/src/commands/cli/release/automerge.ts)_
_See code: [src/commands/cli/release/automerge.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.8-dev.2/src/commands/cli/release/automerge.ts)_

## `sfdx cli release build`

Expand Down Expand Up @@ -325,7 +325,7 @@ EXAMPLES
$ sfdx cli release build --only @salesforce/plugin-source,@salesforce/plugin-info@1.2.3
```

_See code: [src/commands/cli/release/build.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.7/src/commands/cli/release/build.ts)_
_See code: [src/commands/cli/release/build.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.8-dev.2/src/commands/cli/release/build.ts)_

## `sfdx cli releasenotes`

Expand Down Expand Up @@ -366,7 +366,7 @@ EXAMPLES
$ sfdx cli releasenotes --cli sf --markdown > changes.md
```

_See code: [src/commands/cli/releasenotes.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.7/src/commands/cli/releasenotes.ts)_
_See code: [src/commands/cli/releasenotes.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.8-dev.2/src/commands/cli/releasenotes.ts)_

## `sfdx cli tarballs prepare`

Expand Down Expand Up @@ -394,7 +394,7 @@ EXAMPLES
$ sfdx cli tarballs prepare
```

_See code: [src/commands/cli/tarballs/prepare.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.7/src/commands/cli/tarballs/prepare.ts)_
_See code: [src/commands/cli/tarballs/prepare.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.8-dev.2/src/commands/cli/tarballs/prepare.ts)_

## `sfdx cli tarballs smoke`

Expand Down Expand Up @@ -424,7 +424,7 @@ EXAMPLES
$ sfdx cli tarballs smoke
```

_See code: [src/commands/cli/tarballs/smoke.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.7/src/commands/cli/tarballs/smoke.ts)_
_See code: [src/commands/cli/tarballs/smoke.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.8-dev.2/src/commands/cli/tarballs/smoke.ts)_

## `sfdx cli tarballs verify`

Expand Down Expand Up @@ -456,7 +456,7 @@ EXAMPLES
$ sfdx cli tarballs verify --cli sf
```

_See code: [src/commands/cli/tarballs/verify.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.7/src/commands/cli/tarballs/verify.ts)_
_See code: [src/commands/cli/tarballs/verify.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.8-dev.2/src/commands/cli/tarballs/verify.ts)_

## `sfdx cli versions inspect`

Expand Down Expand Up @@ -509,7 +509,7 @@ EXAMPLES
$ sfdx cli versions inspect -l npm -c latest -d chalk -s
```

_See code: [src/commands/cli/versions/inspect.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.7/src/commands/cli/versions/inspect.ts)_
_See code: [src/commands/cli/versions/inspect.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.8-dev.2/src/commands/cli/versions/inspect.ts)_

## `sfdx dependabot automerge`

Expand Down Expand Up @@ -549,7 +549,7 @@ EXAMPLES
$ sfdx dependabot automerge --max-version-bump major
```

_See code: [src/commands/dependabot/automerge.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.7/src/commands/dependabot/automerge.ts)_
_See code: [src/commands/dependabot/automerge.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.8-dev.2/src/commands/dependabot/automerge.ts)_

## `sfdx github check closed`

Expand All @@ -576,7 +576,7 @@ EXAMPLES
$ sfdx github check closed -o me@gus.com
```

_See code: [src/commands/github/check/closed.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.7/src/commands/github/check/closed.ts)_
_See code: [src/commands/github/check/closed.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.8-dev.2/src/commands/github/check/closed.ts)_

## `sfdx npm dependencies pin`

Expand All @@ -602,7 +602,7 @@ DESCRIPTION
in the package.json
```

_See code: [src/commands/npm/dependencies/pin.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.7/src/commands/npm/dependencies/pin.ts)_
_See code: [src/commands/npm/dependencies/pin.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.8-dev.2/src/commands/npm/dependencies/pin.ts)_

## `sfdx npm package release`

Expand Down Expand Up @@ -634,7 +634,7 @@ DESCRIPTION
publish npm package
```

_See code: [src/commands/npm/package/release.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.7/src/commands/npm/package/release.ts)_
_See code: [src/commands/npm/package/release.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.8-dev.2/src/commands/npm/package/release.ts)_

## `sfdx plugins trust verify`

Expand Down Expand Up @@ -702,6 +702,6 @@ EXAMPLES
$ sfdx repositories --json | jq -r '.result[] | select(.name=="sfdx-core") | .packages[] | .url
```

_See code: [src/commands/repositories/index.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.7/src/commands/repositories/index.ts)_
_See code: [src/commands/repositories/index.ts](https://github.com/salesforcecli/plugin-release-management/blob/5.4.8-dev.2/src/commands/repositories/index.ts)_

<!-- commandsstop -->
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@salesforce/plugin-release-management",
"description": "A plugin for preparing and publishing npm packages",
"version": "5.4.7",
"version": "5.4.8-dev.2",
"author": "Salesforce",
"bugs": "https://github.com/forcedotcom/cli/issues",
"type": "module",
Expand Down
19 changes: 15 additions & 4 deletions src/commands/cli/tarballs/smoke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
import { Messages, SfError } from '@salesforce/core';
import { Duration, parseJson, ThrottledPromiseAll } from '@salesforce/kit';
import { Interfaces } from '@oclif/core';
import stripAnsi from 'strip-ansi';
import { PackageJson } from '../../../package.js';
import { testJITInstall } from '../../../jit.js';

Expand Down Expand Up @@ -110,8 +111,18 @@ export default class SmokeTest extends SfCommand<void> {
}

private async getAllCommands(executable: string): Promise<string[]> {
const commandsJson = JSON.parse(await this.execute(executable, 'commands --json', true)) as Array<{ id: string }>;
return commandsJson.map((c) => c.id);
try {
const commandsJson = JSON.parse(await this.execute(executable, 'commands --json', false)) as Array<{
id: string;
}>;
return commandsJson.map((c) => c.id);
} catch (error) {
// eslint-disable-next-line no-console
console.log('Failed to get all commands');
// eslint-disable-next-line no-console
console.log(error);
throw error;
}
}

private async nonVerboseCommandExecution(executable: string, command: string): Promise<void> {
Expand All @@ -130,9 +141,9 @@ export default class SmokeTest extends SfCommand<void> {
const { stdout } = await exec(command, { maxBuffer: 1024 * 1024 * 100 });
if (!silent) {
this.styledHeader(command);
this.log(stdout);
this.log(stripAnsi(stdout));
}
return stdout;
return stripAnsi(stdout);
} catch (e) {
const err = e as Error;
throw new SfError(`Failed: ${command}.\n ${err.message}`, 'SMOKE_TEST_FAILURE', [], err);
Expand Down
Loading