mirror of
https://github.com/docker/actions-toolkit.git
synced 2024-11-23 19:56:09 +08:00
buildx: dest dir optional on install
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
bb8a659d9e
commit
76e5a25cff
@ -45,7 +45,7 @@ export class Install {
|
|||||||
this.standalone = opts?.standalone ?? !Docker.isAvailable;
|
this.standalone = opts?.standalone ?? !Docker.isAvailable;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async download(version: string, dest: string): Promise<string> {
|
public async download(version: string, dest?: string): Promise<string> {
|
||||||
const release: GitHubRelease = await Install.getRelease(version);
|
const release: GitHubRelease = await Install.getRelease(version);
|
||||||
const fversion = release.tag_name.replace(/^v+|v+$/g, '');
|
const fversion = release.tag_name.replace(/^v+|v+$/g, '');
|
||||||
|
|
||||||
@ -59,13 +59,14 @@ export class Install {
|
|||||||
toolPath = await this.fetchBinary(fversion);
|
toolPath = await this.fetchBinary(fversion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dest = dest || (this.standalone ? this.context.tmpDir() : Docker.configDir);
|
||||||
if (this.standalone) {
|
if (this.standalone) {
|
||||||
return this.setStandalone(toolPath, dest);
|
return this.setStandalone(toolPath, dest);
|
||||||
}
|
}
|
||||||
return this.setPlugin(toolPath, dest);
|
return this.setPlugin(toolPath, dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async build(gitContext: string, dest: string): Promise<string> {
|
public async build(gitContext: string, dest?: string): Promise<string> {
|
||||||
// eslint-disable-next-line prefer-const
|
// eslint-disable-next-line prefer-const
|
||||||
let [repo, ref] = gitContext.split('#');
|
let [repo, ref] = gitContext.split('#');
|
||||||
if (ref.length == 0) {
|
if (ref.length == 0) {
|
||||||
@ -98,6 +99,7 @@ export class Install {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dest = dest || Docker.configDir;
|
||||||
if (this.standalone) {
|
if (this.standalone) {
|
||||||
return this.setStandalone(toolPath, dest);
|
return this.setStandalone(toolPath, dest);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user