diff options
author | Georg Gadinger <nilsding@nilsding.org> | 2018-01-19 17:32:49 +0100 |
---|---|---|
committer | Georg Gadinger <nilsding@nilsding.org> | 2018-01-19 17:39:05 +0100 |
commit | f81ee89687d0764cd28355b6455fda84b59592f0 (patch) | |
tree | d0f3d23e39caeea7d35ec0db6d20540a9fb1743b /lib | |
parent | d2ff01867b5d4fcbbf6e6dae1ddcc155392909a3 (diff) | |
download | bundler-f81ee89687d0764cd28355b6455fda84b59592f0.tar.gz |
[Init] Check if the current directory is writable
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/cli/init.rb | 5 |
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) |