Skip to content

Commit

Permalink
Merge pull request #168 from DavidS/pdk-319-pathing
Browse files Browse the repository at this point in the history
(SDK-319) force usage of our ruby

LGTM
  • Loading branch information
James Stocks authored Jul 18, 2017
2 parents f4d2ca9 + 96e97e1 commit 7448a70
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/pdk/cli/exec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ def execute!
@process.environment['GEM_PATH'] = bundler_gem_path
end

# TODO: we should probably more carefully manage PATH and maybe other things too

mod_root = PDK::Util.module_root

unless mod_root
Expand All @@ -129,7 +127,13 @@ def execute!

Dir.chdir(mod_root) do
::Bundler.with_clean_env do
run_process!
tmp = ENV['PATH']
begin
ENV['PATH'] = [RbConfig::CONFIG['bindir'], ENV['PATH']].compact.join(File::PATH_SEPARATOR)
run_process!
ensure
ENV['PATH'] = tmp
end
end
end
else
Expand Down

0 comments on commit 7448a70

Please sign in to comment.