Skip to content

Commit

Permalink
Merge pull request #81 from crazy-max/bake-workdir
Browse files Browse the repository at this point in the history
bake: workdir support for parsing definitions
  • Loading branch information
crazy-max committed Mar 26, 2023
2 parents 85557d0 + e9aa836 commit 210b742
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/buildx/bake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 => {
Expand Down

0 comments on commit 210b742

Please sign in to comment.