From 76e5a25cffb33c81b500a3b042e8e950c2783b3f Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Fri, 17 Feb 2023 23:54:28 +0100 Subject: [PATCH] buildx: dest dir optional on install Signed-off-by: CrazyMax --- src/buildx/install.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/buildx/install.ts b/src/buildx/install.ts index b416967..4a441d9 100644 --- a/src/buildx/install.ts +++ b/src/buildx/install.ts @@ -45,7 +45,7 @@ export class Install { this.standalone = opts?.standalone ?? !Docker.isAvailable; } - public async download(version: string, dest: string): Promise { + public async download(version: string, dest?: string): Promise { const release: GitHubRelease = await Install.getRelease(version); const fversion = release.tag_name.replace(/^v+|v+$/g, ''); @@ -59,13 +59,14 @@ export class Install { toolPath = await this.fetchBinary(fversion); } + dest = dest || (this.standalone ? this.context.tmpDir() : Docker.configDir); if (this.standalone) { return this.setStandalone(toolPath, dest); } return this.setPlugin(toolPath, dest); } - public async build(gitContext: string, dest: string): Promise { + public async build(gitContext: string, dest?: string): Promise { // eslint-disable-next-line prefer-const let [repo, ref] = gitContext.split('#'); if (ref.length == 0) { @@ -98,6 +99,7 @@ export class Install { }); } + dest = dest || Docker.configDir; if (this.standalone) { return this.setStandalone(toolPath, dest); }