Merge pull request #81 from crazy-max/bake-workdir

bake: workdir support for parsing definitions
This commit is contained in:
CrazyMax 2023-03-26 20:14:00 +02:00 committed by GitHub
commit 210b7421e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,7 @@ export class Bake {
this.buildx = opts?.buildx || new Buildx();
}
public async parseDefinitions(sources: Array<string>, targets: Array<string>): Promise<BakeDefinition> {
public async parseDefinitions(sources: Array<string>, targets: Array<string>, workdir?: string): Promise<BakeDefinition> {
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 => {