Skip to content

Instantly share code, notes, and snippets.

@naoty
Created June 22, 2012 07:00
Show Gist options
  • Save naoty/2970881 to your computer and use it in GitHub Desktop.
Save naoty/2970881 to your computer and use it in GitHub Desktop.
binding.pryが含まれていればコミットを中止するフックスクリプト
#!/usr/bin/env ruby
# check binding.pry
cached_files = `git diff --cached --name-only`
if cached_files.split($/).any? { |path| File.read(path).include?('binding.pry') }
puts 'ERROR: binding.pry is found.'
exit 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment