Skip to content

Commit

Permalink
Merge pull request #298 from rodjek/gh-297
Browse files Browse the repository at this point in the history
(PDK-502) Add git mingw paths to PATH
  • Loading branch information
rodjek committed Sep 20, 2017
2 parents 7b3374b + 2514f8b commit f29b071
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions lib/pdk/cli/exec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ def self.git_bindir
@git_dir ||= File.join('private', 'git', Gem.win_platform? ? 'cmd' : 'bin')
end

def self.git_paths
@paths ||= begin
paths = [File.join(PDK::Util.pdk_package_basedir, git_bindir)]

if Gem.win_platform?
paths << File.join(PDK::Util.pdk_package_basedir, 'private', 'git', 'mingw64', 'bin')
paths << File.join(PDK::Util.pdk_package_basedir, 'private', 'git', 'mingw64', 'libexec', 'git-core')
paths << File.join(PDK::Util.pdk_package_basedir, 'private', 'git', 'usr', 'bin')
end

paths
end
end

def self.git_bin
git_bin = Gem.win_platform? ? 'git.exe' : 'git'
vendored_bin_path = File.join(git_bindir, git_bin)
Expand Down Expand Up @@ -154,9 +168,9 @@ def execute!
File.join(@process.environment['GEM_HOME'], 'bin'),
File.join(@process.environment['GEM_PATH'], 'bin'),
package_binpath,
PDK::Util.package_install? ? PDK::CLI::Exec.git_bindir : nil,
ENV['PATH'],
].compact.join(File::PATH_SEPARATOR)
PDK::Util.package_install? ? PDK::CLI::Exec.git_paths : nil,
].compact.flatten.join(File::PATH_SEPARATOR)

mod_root = PDK::Util.module_root

Expand Down

0 comments on commit f29b071

Please sign in to comment.