Skip to content

Commit 87155d0

Browse files
musmomus
authored andcommitted
explicitly specify 7z
1 parent 2bc051e commit 87155d0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/tzdata/archive.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import Compat: @static, is_windows
22

3+
if is_windows()
4+
const exe7z = joinpath(JULIA_HOME, "7z.exe")
5+
end
6+
37
"""
48
extract(archive, directory, [files]; [verbose=false]) -> Void
59
@@ -9,7 +13,7 @@ additional information to STDOUT.
913
"""
1014
function extract(archive, directory, files=AbstractString[]; verbose::Bool=false)
1115
@static if is_windows()
12-
cmd = pipeline(`7z x $archive -y -so`, `7z x -si -y -ttar -o$directory $files`)
16+
cmd = pipeline(`$exe7z x $archive -y -so`, `$exe7z x -si -y -ttar -o$directory $files`)
1317
else
1418
cmd = `tar xvf $archive --directory=$directory $files`
1519
end
@@ -28,7 +32,7 @@ Determines if the given `path` is an archive.
2832
"""
2933
function isarchive(path)
3034
@static if is_windows()
31-
success(`7z t $path -y`)
35+
success(`$exe7z t $path -y`)
3236
else
3337
success(`tar tf $path`)
3438
end
@@ -45,7 +49,7 @@ function readarchive(archive)
4549
header = "-" ^ 24
4650
content = false
4751

48-
cmd = pipeline(`7z x $archive -y -so`, `7z l -si -y -ttar`)
52+
cmd = pipeline(`$exe7z x $archive -y -so`, `$exe7z l -si -y -ttar`)
4953
output = readchomp(pipeline(cmd, stderr=DevNull))
5054
for line in split(output, "\r\n")
5155
# Extract the file name from the last column in the 7-zip output table.

0 commit comments

Comments
 (0)