Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion lib/integration/AdaptFramework/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,17 @@ export default async function adaptBuild ({
].filter(Boolean).join(' ');
exec(cmd, { cwd }, (error, stdout, stderr) => {
if(error || stderr) {
const matches = stdout.match(/>> Error:\s(.+)\s/);
// Surface the salient failure rather than the whole grunt transcript:
// a '>> Error:' task message, else a bare 'Error:' line (e.g. a rollup
// load failure from the javascript task), else the failing-task warning.
// Fall back to the full stdout only when none of those are present.
const matches = stdout.match(/>> Error:\s(.+)/) ||
stdout.match(/^Error:\s(.+)/m) ||
stdout.match(/(Warning: Task .+ failed)/);
const e = new Error('grunt tasks failed')
e.cmd = cmd;
e.raw = matches?.[1] ?? stdout;
e.stdout = stdout;
Comment on lines +35 to +41
e.source = error;
e.stderr = stderr;
return reject(e)
Expand Down
Loading