pluginpal / strapi-plugin-config-sync

:recycle: CLI & GUI for continuous migration of config data across environments

Home Page:https://www.pluginpal.io/plugin/config-sync

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Return non-zero status when diff is not empty.

goodhoko opened this issue · comments

Feature request

Summary

Make config-sync diff return non-zero status in CLI when the diff is not empty.

Why is it needed?

I'd like to use config-sync diff in my pre-commit git hook to check I didn't forget to export the config before committing (and pushing). Currently, I have to parse the command's output. Returning non-zero status when the diff is not empty would make this easier and also would bring the command's API in line with the POSIX diff and diff commands on most systems.

Suggested solution(s)

Just make the return value conditional on the diff contents. Alternatively, provide a --check option to enable this behaviour.

Related issue(s)/PR(s)

Didn't find any.


I'll be happy to submit a PR if you agree with this proposal. Oh and thanks for all you work on this plugin! 🖤

Hi @goodhoko,

Thanks for the feature request.

Can we let the CLI return a non-zero status and keep the output the same as it currently is?

It would be great if you could put up a PR ❤️

Can we let the CLI return a non-zero status and keep the output the same as it currently is?

Definitely, these are independent.

It would be great if you could put up a PR ❤️

Sure. Will post one soon.