Created
February 25, 2017 05:30
-
-
Save tkm-kj/9d5577f70a800c09e9c6e4af5d106ef8 to your computer and use it in GitHub Desktop.
git commit完了前に実行されるスクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
exec ruby -S -x $0 "$@" | |
#! ruby | |
class PreCommitExecutor | |
COMMANDS = ['bundle exec rspec', 'bundle exec rubocop'] | |
def run | |
status = COMMANDS.map {|cmd| system(cmd) }.all? | |
exit(status) | |
end | |
end | |
PreCommitExecutor.new.run |
hookを流したくない時: -n
or --no-verify
オプション
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
置き場:
リポジトリ/.git/hooks/