From 14581244a36c219db3f56d7df9c57583f3d53770 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Mon, 23 Jan 2023 15:11:35 +0100 Subject: [PATCH] buildx: expose methods Signed-off-by: CrazyMax --- src/buildkit.ts | 16 ++++++++-------- src/buildx.ts | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/buildkit.ts b/src/buildkit.ts index 7d8469b..b9e9402 100644 --- a/src/buildkit.ts +++ b/src/buildkit.ts @@ -22,6 +22,14 @@ export class BuildKit { this.buildx = opts?.buildx || new Buildx(); } + public tmpDir() { + return this.tmpdir; + } + + public tmpName(options?: tmp.TmpNameOptions): string { + return tmp.tmpNameSync(options); + } + private async getBuilderInfo(name: string): Promise { const builder = new Builder({buildx: this.buildx}); return builder.inspect(name); @@ -114,12 +122,4 @@ export class BuildKit { fs.writeFileSync(configFile, s); return configFile; } - - private tmpDir() { - return this.tmpdir; - } - - private tmpName(options?: tmp.TmpNameOptions): string { - return tmp.tmpNameSync(options); - } } diff --git a/src/buildx.ts b/src/buildx.ts index f86c0a6..73a8e43 100644 --- a/src/buildx.ts +++ b/src/buildx.ts @@ -22,6 +22,14 @@ export class Buildx { this.version = this.getVersion(); } + public tmpDir() { + return this.tmpdir; + } + + public tmpName(options?: tmp.TmpNameOptions): string { + return tmp.tmpNameSync(options); + } + public getCommand(args: Array) { return { command: this.standalone ? 'buildx' : 'docker', @@ -179,12 +187,4 @@ export class Buildx { } return false; } - - private tmpDir() { - return this.tmpdir; - } - - private tmpName(options?: tmp.TmpNameOptions): string { - return tmp.tmpNameSync(options); - } }