From e7c5729fe0fae1382b5f1894155d058c9518b644 Mon Sep 17 00:00:00 2001 From: Diana Sentoso Date: Wed, 16 Jun 2021 10:27:28 -0700 Subject: [PATCH] fix: add success msg + fix tar ext --- src/commands/install.ts | 9 ++++++++- src/commands/update.ts | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/commands/install.ts b/src/commands/install.ts index 4f222728..67d484c2 100644 --- a/src/commands/install.ts +++ b/src/commands/install.ts @@ -44,12 +44,17 @@ export default class InstallCommand extends UpdateCommand { .filter((dirOrFile) => dirOrFile !== 'bin' && dirOrFile !== 'current'); if (versions.includes(targetVersion)) { + this.log( + `Found ${targetVersion} installed locally. Attempting to switch to ${targetVersion} now.`, + ); + await this.updateToExistingVersion(targetVersion); this.currentVersion = await this.determineCurrentVersion(); this.updatedVersion = targetVersion; if (channelUpdateRequested) { await this.setChannel(); } + this.log(`Success! You are now on ${targetVersion}!`); } else { const explicitVersion = isExplicitVersion ? targetVersion : null; cli.action.start(`${this.config.name}: Updating CLI`); @@ -67,7 +72,9 @@ export default class InstallCommand extends UpdateCommand { this.debug('tidy'); await this.tidy(); await this.config.runHook('update', { channel: this.channel }); - + this.log( + `Success! Installed ${targetVersion}. You are now on ${targetVersion}!`, + ); this.debug('done'); cli.action.stop(); } diff --git a/src/commands/update.ts b/src/commands/update.ts index 7967b253..90892d0a 100644 --- a/src/commands/update.ts +++ b/src/commands/update.ts @@ -178,7 +178,7 @@ export default class UpdateCommand extends Command { bin: this.config.bin, platform: this.config.platform, arch: this.config.arch, - ext: targetVersion ? 'tar.gz' : 'gz', + ext: targetVersion ? '.tar.gz' : 'gz', }), ); const { response: stream } = await http.stream(gzUrl);