mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-27 13:54:08 +03:00
Fix build step logic to show elm-review contract violation errors.
This commit is contained in:
parent
a6870989a1
commit
05bd7b0bff
@ -147,7 +147,15 @@ async function run(options) {
|
|||||||
await compileCli;
|
await compileCli;
|
||||||
await compileClientDone;
|
await compileClientDone;
|
||||||
} catch (cliError) {
|
} catch (cliError) {
|
||||||
console.error(cliError);
|
const reviewOutput = JSON.parse(await runElmReview());
|
||||||
|
const isParsingError = reviewOutput.errors.some((reviewError) => {
|
||||||
|
return reviewError.errors.some((item) => item.rule === "ParsingError");
|
||||||
|
});
|
||||||
|
if (isParsingError) {
|
||||||
|
console.error(cliError);
|
||||||
|
} else {
|
||||||
|
console.error(restoreColorSafe(reviewOutput));
|
||||||
|
}
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
await portDataSourceCompiled;
|
await portDataSourceCompiled;
|
||||||
@ -164,21 +172,7 @@ async function run(options) {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
buildError = true;
|
buildError = true;
|
||||||
try {
|
process.exitCode = 1;
|
||||||
const reviewOutput = JSON.parse(await runElmReview());
|
|
||||||
const isParsingError = reviewOutput.errors.some((reviewError) => {
|
|
||||||
return reviewError.errors.some((item) => item.rule === "ParsingError");
|
|
||||||
});
|
|
||||||
if (isParsingError) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.error(restoreColorSafe(reviewOutput));
|
|
||||||
}
|
|
||||||
process.exitCode = 1;
|
|
||||||
} catch (noElmReviewErrors) {
|
|
||||||
console.error(error);
|
|
||||||
} finally {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user