diff options
Diffstat (limited to 'lib/sisu/v3/git.rb')
-rw-r--r-- | lib/sisu/v3/git.rb | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/sisu/v3/git.rb b/lib/sisu/v3/git.rb index 322b5846..2e76fa4a 100644 --- a/lib/sisu/v3/git.rb +++ b/lib/sisu/v3/git.rb @@ -136,16 +136,22 @@ module SiSU_Git end def git_init unless FileTest.directory?("#{@git_path[:fnb]}/.git") - system("cd #{@git_path[:fnb]}\ - && git init - ") + pwd=Dir.pwd + Dir.chdir(@git_path[:fnb]) + system("git init ") + Dir.chdir(pwd) end end def git_commit - system("cd #{@git_path[:fnb]} \ - && git add . \ - && git commit -a - ") + if FileTest.directory?("#{@git_path[:fnb]}") + pwd=Dir.pwd + Dir.chdir(@git_path[:fnb]) + system(" + git add . \ + && git commit -a + ") + Dir.chdir(pwd) + end end def populate def identify_language_versions |