Skip to content

Commit

Permalink
Update wkhtmltopdf
Browse files Browse the repository at this point in the history
There was an error on macOS when a hard link to the archive exists (could be Time Machine). Even with `--keep` it states: 'Input file has 1 other link'. Using `--force` fixes this.
  • Loading branch information
joergschiller committed May 14, 2019
1 parent f843ec5 commit 4e225b9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/wkhtmltopdf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ suffix = case RbConfig::CONFIG['host_os']
binary = "#{__FILE__}_#{suffix}"

if File.exist?("#{binary}.bz2") && !File.exist?(binary)
system("bzip2 --decompress --keep #{binary}.bz2") ||
# There was an error on macOS when a hard link to the archive exists (could be
# Time Machine). Even with `--keep` it states: 'Input file has 1 other link'.
# Using `--force` fixes this.
system("bzip2 --decompress --keep --force #{binary}.bz2") ||
raise("Decompression of #{binary}.bz2 failed. Do you have bzip2 installed?")
end

Expand Down

0 comments on commit 4e225b9

Please sign in to comment.