summaryrefslogtreecommitdiff
path: root/lib/bundler/cli/gem.rb
diff options
context:
space:
mode:
authorColby Swandale <colby@taplaboratories.com>2017-03-19 17:52:03 +1100
committerColby Swandale <colby@taplaboratories.com>2017-03-19 17:52:03 +1100
commitd553b1802c12f78245a0929835e9f003c13050e7 (patch)
tree3af9a0695d4661223edc47df162a237888d93320 /lib/bundler/cli/gem.rb
parent81d53b52444572cf1454da4c741242e2dd47de5c (diff)
downloadbundler-d553b1802c12f78245a0929835e9f003c13050e7.tar.gz
dont init new git repo unless git is installed on gem command
Diffstat (limited to 'lib/bundler/cli/gem.rb')
-rw-r--r--lib/bundler/cli/gem.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb
index 3d746f50d6..5371c6d82f 100644
--- a/lib/bundler/cli/gem.rb
+++ b/lib/bundler/cli/gem.rb
@@ -137,10 +137,12 @@ module Bundler
path.chmod(executable)
end
- Bundler.ui.info "Initializing git repo in #{target}"
- Dir.chdir(target) do
- `git init`
- `git add .`
+ if Bundler.git_present?
+ Bundler.ui.info "Initializing git repo in #{target}"
+ Dir.chdir(target) do
+ `git init`
+ `git add .`
+ end
end
# Open gemspec in editor