Class: Pairing::Commands::RepoSetup

Inherits:
Base
  • Object
show all
Defined in:
lib/pairing/commands/repo_setup.rb

Constant Summary collapse

PRE_COMMIT_FILE =
'.git/hooks/pre-commit'

Instance Method Summary collapse

Methods inherited from Base

run

Instance Method Details

#run(argv) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/pairing/commands/repo_setup.rb', line 4

def run(argv)
  File.open(PRE_COMMIT_FILE, 'w') do |f|
    f << %{#!/bin/bash\nexec ey-pair pre-commit}
  end
  File.chmod(0700, PRE_COMMIT_FILE)
  puts "Wrote pre-commit hook to collect pair info"
end