#!/usr/bin/env ruby require 'pre-commit/cli' PRE_COMMIT_HOOK_PATH = '.git/hooks/pre-commit' if ARGV[0] != "install" puts "Usage: pre-commit install" exit(1) end if !File.exists?(".git") puts "No .git directory found." exit(1) end cli = PreCommit::Cli.new cli.install puts "Installed hook: #{PRE_COMMIT_HOOK_PATH}" puts