bin/autoproj_install in autoproj-2.0.0.rc12 vs bin/autoproj_install in autoproj-2.0.0.rc13

- old
+ new

@@ -239,11 +239,11 @@ *local, "--bindir=#{File.join(bundler_gem_home, 'bin')}", 'bundler') if !result STDERR.puts "FATAL: failed to install bundler in #{dot_autoproj}" - exit 1 + return end File.join(bundler_gem_home, 'bin', 'bundler') end def find_bundler @@ -253,15 +253,12 @@ end clean_path = env_for_child['PATH'] STDERR.puts "cannot find 'bundler' in PATH=#{clean_path}#{File::PATH_SEPARATOR}#{gem_bindir}" STDERR.puts "installing it now ..." - result = system( - clean_env.merge('GEM_PATH' => "", 'GEM_HOME' => bundler_gem_home), - Gem.ruby, '-S', 'gem', 'install', 'bundler') - - if !result + bundler = install_bundler + if !bundler if ENV['PATH'] != clean_path STDERR.puts " it appears that you already have some autoproj-generated env.sh loaded" STDERR.puts " - if you are running 'autoproj upgrade', please contact the autoproj author at https://github.com/rock-core/autoproj/issues/new" STDERR.puts " - if you are running an install, try again in a console where the env.sh is not loaded" exit 1 @@ -270,11 +267,10 @@ STDERR.puts " or call this command again with --private-bundler to have it installed in the workspace" exit 1 end end - bundler = File.join(bundler_gem_home, 'bin', 'bundler') if File.exist?(bundler) bundler else STDERR.puts "gem install bundler returned successfully, but still cannot find bundler in #{bundler}" nil @@ -414,10 +410,12 @@ end def install if private_bundler? puts "Installing bundler in #{bundler_gem_home}" - bundler = install_bundler + if !(bundler = install_bundler) + exit 1 + end elsif bundler = find_bundler puts "Detected bundler at #{bundler}" else exit 1 end