From e9aa8365e3b073eb267957821d1f06b9625e1246 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Sun, 26 Mar 2023 19:42:37 +0200 Subject: [PATCH] bake: workdir support for parsing definitions Signed-off-by: CrazyMax --- src/buildx/bake.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/buildx/bake.ts b/src/buildx/bake.ts index 7576a9e..2e92f69 100644 --- a/src/buildx/bake.ts +++ b/src/buildx/bake.ts @@ -32,7 +32,7 @@ export class Bake { this.buildx = opts?.buildx || new Buildx(); } - public async parseDefinitions(sources: Array, targets: Array): Promise { + public async parseDefinitions(sources: Array, targets: Array, workdir?: string): Promise { const args = ['bake']; let remoteDef; @@ -58,6 +58,7 @@ export class Bake { const printCmd = await this.buildx.getCommand([...args, '--print', ...targets]); return await Exec.getExecOutput(printCmd.command, printCmd.args, { + cwd: workdir, ignoreReturnCode: true, silent: true }).then(res => {