summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/cli/init.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/bundler/cli/init.rb b/lib/bundler/cli/init.rb
index fa53e7c74b..40df797269 100644
--- a/lib/bundler/cli/init.rb
+++ b/lib/bundler/cli/init.rb
@@ -13,6 +13,11 @@ module Bundler
exit 1
end
+ unless File.writable?(Dir.pwd)
+ Bundler.ui.error "Can not create #{gemfile} as the current directory is not writable."
+ exit 1
+ end
+
if options[:gemspec]
gemspec = File.expand_path(options[:gemspec])
unless File.exist?(gemspec)