Skip to content

Commit

Permalink
Merge pull request oclif#26 from sumwatshade/fix/install-no-reexec
Browse files Browse the repository at this point in the history
fix: no reexec on install
  • Loading branch information
ArtemisD authored Jun 17, 2021
2 parents ca44f2f + f55aa79 commit e23b7e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/commands/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default class InstallCommand extends UpdateCommand {
this.debug(`Updating to ${this.updatedVersion}`);
const reason = await this.skipUpdate();
if (reason) cli.action.stop(reason || 'done');
else await this.update(manifest, this.channel, explicitVersion);
else await this.update(manifest, this.channel, explicitVersion, false);
this.debug('tidy');
await this.tidy();
await this.config.runHook('update', { channel: this.channel });
Expand Down
9 changes: 7 additions & 2 deletions src/commands/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ export default class UpdateCommand extends Command {
return body;
} catch (error) {
if (error.statusCode === 403)
throw new Error(`HTTP 403: Invalid channel ${this.channel}`);
throw new Error(
`HTTP 403: This could mean that you are being restricted from accessing this version, or that you are providing an invalid channel (${this.channel})`,
);
throw error;
}
}
Expand Down Expand Up @@ -226,6 +228,7 @@ export default class UpdateCommand extends Command {
manifest: IManifest,
channel = this.channel,
targetVersion?: string,
reexec = true,
) {
const { channel: manifestChannel } = manifest;
if (manifestChannel) channel = manifestChannel;
Expand All @@ -247,7 +250,9 @@ export default class UpdateCommand extends Command {
await this.setChannel();
await this.createBin(this.updatedVersion);
await this.touch();
await this.reexec();
if (reexec) {
await this.reexec();
}
}

protected async updateToExistingVersion(version: string) {
Expand Down

0 comments on commit e23b7e4

Please sign in to comment.