diff options
author | Andre Arko <andre@arko.net> | 2014-03-31 17:58:26 +0800 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2014-03-31 17:58:39 +0800 |
commit | b98022843434b7d2482ce62f4fa7a2d2422b90c7 (patch) | |
tree | f5911a47464f7cee388e64ad07e7bda4dce9dc61 /lib/bundler/installer.rb | |
parent | b31fcfb9a3f2c0f7a72a68c3ba799abb22abbf1a (diff) | |
download | bundler-b98022843434b7d2482ce62f4fa7a2d2422b90c7.tar.gz |
install to new dir inside root-owned dir
Diffstat (limited to 'lib/bundler/installer.rb')
-rw-r--r-- | lib/bundler/installer.rb | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb index 5643b202aa..e220aed2c6 100644 --- a/lib/bundler/installer.rb +++ b/lib/bundler/installer.rb @@ -48,13 +48,7 @@ module Bundler # # Finally: TODO add documentation for how the standalone process works. def run(options) - # Create the BUNDLE_PATH directory - begin - Bundler.bundle_path.mkpath unless Bundler.bundle_path.exist? - rescue Errno::EEXIST - raise PathError, "Could not install to path `#{Bundler.settings[:path]}` " + - "because of an invalid symlink. Remove the symlink so the directory can be created." - end + create_bundle_path if Bundler.settings[:frozen] @definition.ensure_equivalent_gemfile_and_lockfile(options[:deployment]) @@ -325,5 +319,13 @@ module Bundler remains[dep.name] end end + + def create_bundle_path + Bundler.mkdir_p(Bundler.bundle_path.to_s) unless Bundler.bundle_path.exist? + rescue Errno::EEXIST + raise PathError, "Could not install to path `#{Bundler.settings[:path]}` " + + "because of an invalid symlink. Remove the symlink so the directory can be created." + end + end end |