Skip to content

Commit

Permalink
Merge pull request #523 from klab-systems/bugfix_issue364
Browse files Browse the repository at this point in the history
Resolve 7zip command checks for proper PS fallback
  • Loading branch information
bastelfreak authored Jun 26, 2024
2 parents 91306b9 + 7d6429a commit 4225c6e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/puppet_x/bodeco/archive.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ def extract(path = root_dir, opts = {})
private

def win_7zip
if ENV['path'].include?('7-Zip') || system('where 7z.exe')
if system('where 7z.exe')
'7z.exe'
elsif File.directory?('C:\\Program Files\\7-Zip')
'C:\\Program Files\\7-Zip\\7z.exe'
elsif File.directory?('C:\\Program Files (x86)\\7-zip')
'C:\\Program Files (x86)\\7-Zip\\7z.exe'
elsif File.exist?('C:\Program Files\7-Zip\7z.exe')
'C:\Program Files\7-Zip\7z.exe'
elsif File.exist?('C:\Program Files (x86)\7-zip\7z.exe')
'C:\Program Files (x86)\7-Zip\7z.exe'
elsif @file_path =~ %r{.zip"$}
# Fallback to powershell for zipfiles - this works with windows
# 2012+ if your powershell/.net is too old the script will fail
Expand Down

0 comments on commit 4225c6e

Please sign in to comment.