From f81ee89687d0764cd28355b6455fda84b59592f0 Mon Sep 17 00:00:00 2001 From: Georg Gadinger Date: Fri, 19 Jan 2018 17:32:49 +0100 Subject: [Init] Check if the current directory is writable --- lib/bundler/cli/init.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib') 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) -- cgit v1.2.1