-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-0 exit code when comparison detects changes #505
Comments
Anyone know if this is being worked on? |
If noone said so, I guess not. |
@dargmuesli I wrote something in node (modeled after your code) const jq = require('node-jq');
const path = require('path');
const outJson = path.join(__dirname, 'working-directory/out.json');
async function runCheck() {
const failedItems = await jq.run('.failedItems[]', outJson, {});
if (failedItems.length) {
console.error('You have diff changes, please view them');
}
const newItems = await jq.run('.newItems[]', outJson, {});
if (newItems.length) {
console.error('You have new items, please view them');
}
const deletedItems = await jq.run('.deletedItems[]', outJson, {});
if (deletedItems.length) {
console.error('You have deleted items, please view them');
}
if (failedItems.length || deletedItems.length || newItems.length) {
console.error('Run "npm run view:diff" to view');
console.error(
'If you are satisfied with the changes, run "npm run diff:approve"',
);
process.exit(1);
}
}
runCheck().catch((err) => {
console.error(err);
process.exit(1);
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey there, would it be possible to let
reg-suit compare
exit with a non-0 exit code when changes are detected? This way it's easy for scripts to decide whether to continue, e.g. CI systems could then fail the build. Other tools like Creevey already work like this. Alternatively, how could I detect thatreg-suit compare
detected changes?The text was updated successfully, but these errors were encountered: