Class: SimpleTemplater::Hooks::GitRepository

Inherits:
Hook
  • Object
show all
Defined in:
lib/simple-templater/hooks/postprocess/git_repository.rb

Instance Attribute Summary

Attributes inherited from Hook

#context, #reply

Instance Method Summary collapse

Methods inherited from Hook

find, hooks, inherited, #initialize, invoke, #key, #will_run?

Constructor Details

This class inherits a constructor from SimpleTemplater::Hooks::Hook

Instance Method Details

#questionObject



8
9
10
# File 'lib/simple-templater/hooks/postprocess/git_repository.rb', line 8

def question
  CLI.yes?("Do you want to initialize Git repozitory and do initial commit?")
end

#runObject



12
13
14
15
16
# File 'lib/simple-templater/hooks/postprocess/git_repository.rb', line 12

def run
  sh "git init"
  sh "git add ."
  sh "git commit -a -m 'Initial import'"
end