bake: correctly match error when parsing definition

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2023-12-20 13:58:27 +01:00
parent 5430d017a5
commit 3a20771080
No known key found for this signature in database
GPG Key ID: ADE44D8C9D44FBE4

View File

@ -77,7 +77,7 @@ export class Bake {
silent: true silent: true
}).then(res => { }).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) { 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()); return <BakeDefinition>JSON.parse(res.stdout.trim());
}); });