From 8b761b6cfe504aafc561d3d60183051010740c11 Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdxcode@users.noreply.github.com> Date: Tue, 19 Jun 2018 12:26:26 -0700 Subject: [PATCH] fix: use OCLIF_CLIENT_HOME if exists (#25) --- src/commands/update.ts | 2 +- src/hooks/init.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/update.ts b/src/commands/update.ts index 465f9798..699b9c74 100644 --- a/src/commands/update.ts +++ b/src/commands/update.ts @@ -20,7 +20,7 @@ export default class UpdateCommand extends Command { private autoupdate!: boolean private channel!: string - private readonly clientRoot = path.join(this.config.dataDir, 'client') + private readonly clientRoot = this.config.scopedEnvVar('OCLIF_CLIENT_HOME') || path.join(this.config.dataDir, 'client') private readonly clientBin = path.join(this.clientRoot, 'bin', this.config.windows ? `${this.config.bin}.cmd` : this.config.bin) async run() { diff --git a/src/hooks/init.ts b/src/hooks/init.ts index d88dd084..e84a9356 100644 --- a/src/hooks/init.ts +++ b/src/hooks/init.ts @@ -24,7 +24,7 @@ export const init: Config.Hook<'init'> = async function (opts) { const lastrunfile = path.join(this.config.cacheDir, 'lastrun') const autoupdatefile = path.join(this.config.cacheDir, 'autoupdate') const autoupdatelogfile = path.join(this.config.cacheDir, 'autoupdate.log') - const clientRoot = path.join(this.config.dataDir, 'client') + const clientRoot = this.config.scopedEnvVar('OCLIF_CLIENT_HOME') || path.join(this.config.dataDir, 'client') const autoupdateEnv = { ...process.env,