Class: SwiftLibTemplater::InitializeGitRepositoryCommand
- Inherits:
-
Object
- Object
- SwiftLibTemplater::InitializeGitRepositoryCommand
- Defined in:
- lib/swift_lib_templater/initialize_git_repository_command.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(dir) ⇒ InitializeGitRepositoryCommand
constructor
A new instance of InitializeGitRepositoryCommand.
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
#execute ⇒ Object
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 |