aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/git.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v3/git.rb')
-rw-r--r--lib/sisu/v3/git.rb22
1 files changed, 14 insertions, 8 deletions
diff --git a/lib/sisu/v3/git.rb b/lib/sisu/v3/git.rb
index 45eb3f75..2e76fa4a 100644
--- a/lib/sisu/v3/git.rb
+++ b/lib/sisu/v3/git.rb
@@ -114,7 +114,7 @@ module SiSU_Git
end
unless @opt.cmd =~/q/
@opt.cmd=~/[MVvz]/ \
- ? SiSU_Screen::Ansi.new(@opt.cmd,'Git path',@git_path[:fnb]).green_hi_blue \
+ ? SiSU_Screen::Ansi.new(@opt.cmd,'Git path',@git_path[:fnb]).green_hi_blue
: SiSU_Screen::Ansi.new(@opt.cmd,'Git path',@git_path[:fnb]).green_title_hi
SiSU_Screen::Ansi.new(@opt.cmd,"Git path","#{@opt.fns} -> #{@git_path[:fnb]}").warn if @opt.cmd =~/[MVv]/
end
@@ -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