Skip to content

Commit

Permalink
bake: correctly match error when parsing definition
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Dec 20, 2023
1 parent 5430d01 commit 3a20771
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/buildx/bake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class Bake {
silent: true
}).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(res.stderr);
throw new Error(`cannot parse bake definitions: ${res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error'}`);
}
return <BakeDefinition>JSON.parse(res.stdout.trim());
});
Expand Down

0 comments on commit 3a20771

Please sign in to comment.