Skip to content

Commit

Permalink
fix: disable autoupdates entirely when env var is set
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed May 9, 2018
1 parent 7bccd1a commit 8328b4f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion src/commands/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ export default class UpdateCommand extends Command {

private async skipUpdate(): Promise<string | false> {
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'
Expand Down
1 change: 1 addition & 0 deletions src/hooks/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 8328b4f

Please sign in to comment.