-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: improve behavior when config file is missing #53
Conversation
Codecov Report
@@ Coverage Diff @@
## master #53 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 3 3
Lines 134 141 +7
=====================================
+ Hits 134 141 +7
Continue to review full report at Codecov.
|
echo "See https://github.com/swellaby/rusty-hook#configure for more information" | ||
echo | ||
echo "If you were trying to remove rusty-hook, then you should also delete the git hook files to remove this warning" | ||
echo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
if [ $rhExitCode -ne 0 ]; then | ||
# shellcheck disable=SC2170,SC1083 | ||
if [ $rhExitCode -eq {{NO_CONFIG_FILE_EXIT_CODE}} ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{NO_CONFIG_FILE_EXIT_CODE}}
is tokenized here so that rusty-hook can inject the correct value as part of writing all the git hook script files. Unsurprisingly, shellcheck
doesn't like that, hence the above inline disables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
I agree, looks like a good addition |
Changes
rusty-hook
cli to respond with a specific exit code (currently3
) when the internal error was a missing config filerusty-hook
.0
, allowing the git hook workflow to continue. The pre-commit hook will also display a warning message to the user:Related Issues