From 8328b4fafc220345179a01c36bbacc67c9169b3b Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdxcode@users.noreply.github.com> Date: Wed, 9 May 2018 00:36:05 -0700 Subject: [PATCH] fix: disable autoupdates entirely when env var is set --- src/commands/update.ts | 1 - src/hooks/init.ts | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/update.ts b/src/commands/update.ts index f4fc7d7f..d29af152 100644 --- a/src/commands/update.ts +++ b/src/commands/update.ts @@ -98,7 +98,6 @@ export default class UpdateCommand extends Command { private async skipUpdate(): Promise { if (!this.config.binPath) return this.config.scopedEnvVar('UPDATE_INSTRUCTIONS') || 'not updatable' - if (this.autoupdate && this.config.scopedEnvVar('DISABLE_AUTOUPDATE') === '1') return 'autoupdates disabled' const manifest = await this.fetchManifest() if (this.config.version === manifest.version) { if (this.config.scopedEnvVar('HIDE_UPDATED_MESSAGE')) return 'done' diff --git a/src/hooks/init.ts b/src/hooks/init.ts index 809d1452..745c3d0b 100644 --- a/src/hooks/init.ts +++ b/src/hooks/init.ts @@ -19,6 +19,7 @@ async function mtime(f: string) { export const init: Config.Hook<'init'> = async function (opts) { if (opts.id === 'update') return + if (opts.config.scopedEnvVarTrue('DISABLE_AUTOUPDATE')) return cli.config.errlog = opts.config.errlog const binPath = this.config.binPath || this.config.bin const lastrunfile = path.join(this.config.cacheDir, 'lastrun')