Class: SwiftLibTemplater::InitializeGitRepositoryCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/swift_lib_templater/initialize_git_repository_command.rb

Instance Method Summary collapse

Constructor Details

#initialize(dir) ⇒ InitializeGitRepositoryCommand

Returns a new instance of InitializeGitRepositoryCommand.



4
5
6
# File 'lib/swift_lib_templater/initialize_git_repository_command.rb', line 4

def initialize(dir)
  @dir = dir
end

Instance Method Details

#executeObject



8
9
10
11
12
13
14
15
# File 'lib/swift_lib_templater/initialize_git_repository_command.rb', line 8

def execute()
  Dir.chdir(@dir)
  systemWithoutOutput "git init ."
  systemWithoutOutput "git commit -m 'Initial commit' --allow-empty"
  systemWithoutOutput "git checkout -b develop"
  systemWithoutOutput "git add ."
  systemWithoutOutput "git commit -m 'Initial import'"
end