Merge pull request #225 from crazy-max/fix-bake-error
Some checks failed
publish / publish (push) Has been cancelled

bake: correctly match error when parsing definition
This commit is contained in:
CrazyMax
2023-12-21 11:44:07 +01:00
committed by GitHub

View File

@@ -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());
});