Merge pull request #225 from crazy-max/fix-bake-error

bake: correctly match error when parsing definition
This commit is contained in:
CrazyMax 2023-12-21 11:44:07 +01:00 committed by GitHub
commit a99fb34091
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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