Sha256: 36088e88d5dad3337cd2f10ead07f26839e215768ab80a1ada6bfd2fda2406d3

Contents?: true

Size: 551 Bytes

Versions: 11

Compression:

Stored size: 551 Bytes

Contents

# encoding: utf-8

require "simple-templater/hooks/hook"

# run your generator with --git-repository resp. --no-git-repository
module SimpleTemplater::Hooks
  class GitRepository < Hook
    def question
      CLI.yes?("Do you want to initialize Git repozitory and do initial commit?")
    end

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

__END__
OR

hook(:git_repository, "Do you want to initialize Git repozitory and do initial commit?") do |hook|
  # content of run method
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
simple-templater-0.0.1.6 lib/simple-templater/hooks/postprocess/git_repository.rb
simple-templater-0.0.1.5 lib/simple-templater/hooks/postprocess/git_repository.rb
simple-templater-0.0.1.4 lib/simple-templater/hooks/postprocess/git_repository.rb
simple-templater-0.0.1.3 lib/simple-templater/hooks/postprocess/git_repository.rb
simple-templater-0.2.pre lib/simple-templater/hooks/postprocess/git_repository.rb
simple-templater-0.0.1.2 lib/simple-templater/hooks/postprocess/git_repository.rb
simple-templater-0.0.1.1 lib/simple-templater/hooks/postprocess/git_repository.rb
rango-0.0.6 vendor/simple-templater/lib/simple-templater/hooks/postprocess/git_repository.rb
rango-0.1.pre vendor/simple-templater/lib/simple-templater/hooks/postprocess/git_repository.rb
simple-templater-0.1.pre lib/simple-templater/hooks/postprocess/git_repository.rb
simple-templater-0.0.1 lib/simple-templater/hooks/postprocess/git_repository.rb