From 8b146fbb13b14a6b7c930d197f7abfbaf6d5f7e2 Mon Sep 17 00:00:00 2001 From: Matthew Draper Date: Fri, 8 Jul 2022 00:07:23 +0930 Subject: [PATCH] Set BUNDLE_BIN_PATH during exec Our command is obviously less featureful than 'bundle', but if you're running inside a Gel context, I think you still have a better chance of success from 'gel' than from 'bundle'. --- lib/gel/command/exec.rb | 1 + lib/gel/gemspec_parser.rb | 1 + lib/gel/package/installer.rb | 1 + 3 files changed, 3 insertions(+) diff --git a/lib/gel/command/exec.rb b/lib/gel/command/exec.rb index 03f32ca7..41484535 100644 --- a/lib/gel/command/exec.rb +++ b/lib/gel/command/exec.rb @@ -17,6 +17,7 @@ def run(command_line, from_stub: false) end ENV["RUBYLIB"] = Gel::Environment.modified_rubylib + ENV["BUNDLE_BIN_PATH"] = File.expand_path("../../../exe/gel", __dir__) if execute_inline?(expanded_command) if command_source == :path || command_source == :original diff --git a/lib/gel/gemspec_parser.rb b/lib/gel/gemspec_parser.rb index 9735ed09..7f38cf69 100644 --- a/lib/gel/gemspec_parser.rb +++ b/lib/gel/gemspec_parser.rb @@ -79,6 +79,7 @@ def self.parse(content, filename, lineno = 1, root: File.dirname(filename), isol "GEL_DEBUG" => nil, "GEL_GEMFILE" => "", "GEL_LOCKFILE" => "", + "BUNDLE_BIN_PATH" => nil, }, RbConfig.ruby, "-r", File.expand_path("compatibility", __dir__), diff --git a/lib/gel/package/installer.rb b/lib/gel/package/installer.rb index cd7d5899..635cbba1 100644 --- a/lib/gel/package/installer.rb +++ b/lib/gel/package/installer.rb @@ -132,6 +132,7 @@ def build_environment(rake: false) "GEL_STORE" => File.expand_path(@root_store.root), "GEL_GEMFILE" => gemfile, "GEL_LOCKFILE" => lockfile, + "BUNDLE_BIN_PATH" => File.expand_path("../../../exe/gel", __dir__), } end