Skip to content

Commit

Permalink
feat: ns -v --json to skip update checks
Browse files Browse the repository at this point in the history
  • Loading branch information
rigor789 committed Oct 25, 2021
1 parent e59f1ad commit d7330b0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/common/dispatchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ export class CommandDispatcher implements ICommandDispatcher {
private async printVersion(): Promise<void> {
this.$logger.info(this.$staticConfig.version);

if (this.$options.json) {
// we don't check for updates when --json is passed
// useful for tools that rely on the output of the command
return;
}

const spinner = this.$terminalSpinnerService.createSpinner();
spinner.start("Checking for updates...");
const nativescriptCliVersion = await this.$versionsService.getNativescriptCliVersion();
Expand Down

0 comments on commit d7330b0

Please sign in to comment.