lib/shaddox/target.rb in shaddox-0.0.3 vs lib/shaddox/target.rb in shaddox-0.0.4
- old
+ new
@@ -31,11 +31,16 @@
ruby_installed = exec 'type ruby >/dev/null'
raise TargetError, "Ruby is required to use shaddox. Please install it manually." unless ruby_installed
gem_installed = exec 'type gem >/dev/null'
raise TargetError, "Gem is required to use shaddox. Please install it manually." unless gem_installed
shaddox_installed = lambda { exec 'gem list shaddox -i' }
- info "Installing/updating shaddox...", 1
- exec "sudo gem install shaddox"
+ if shaddox_installed.call()
+ info "Updating shaddox...", 1
+ exec "sudo gem update shaddox"
+ else
+ info "Installing shaddox...", 1
+ exec "sudo gem install shaddox"
+ end
unless shaddox_installed.call()
raise TargetError, "Shaddox could not be automatically installed. Please install manually with 'gem install shaddox'."
end
# Push the shadow script to tmpdir: