Skip to content

Commit 2ccf90a

Browse files
committed
Use Bundler.with_unbundled_env
1 parent f14e7ef commit 2ccf90a

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

exe/importmap-update

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ when :run
171171
# that `bundle exec` loads octokit; if that leaks into bin/importmap the
172172
# Rails app's boot.rb will try to use the action's Gemfile instead of its
173173
# own, which doesn't have Rails.
174-
runner = Importmap::Update::Commands::ShellRunner.new(env: {"BUNDLE_GEMFILE" => nil})
174+
runner = Importmap::Update::Commands::ShellRunner.new
175175
gh = Importmap::Update::GitHubClient.new(repo: repo, token: token)
176176
git = Importmap::Update::GitClient.new(
177177
runner: runner,

lib/commands.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ def initialize(cwd: nil, env: nil)
4747
def run(*argv)
4848
opts = {}
4949
opts[:chdir] = @cwd if @cwd
50-
stdout, stderr, status = Open3.capture3(@env, *argv, **opts)
51-
Result.new(stdout: stdout, stderr: stderr, exit_code: status.exitstatus)
50+
Bundler.with_unbundled_env do
51+
stdout, stderr, status = Open3.capture3(@env, *argv, **opts)
52+
Result.new(stdout: stdout, stderr: stderr, exit_code: status.exitstatus)
53+
end
5254
end
5355

5456
# Raises on non-zero exit. Use when you have no recovery strategy

0 commit comments

Comments
 (0)