Skip to content

Commit 59db55c

Browse files
Fix *nix build behavior
1 parent be43458 commit 59db55c

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

deps/build.jl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,22 @@ if endswith(target_url, "zip")
4747
close(zarchive)
4848

4949
elseif endswith(target_url, "tar.gz")
50-
# dir_name = split(replace(target, ".tar.gz" => ""), "/")[end]
50+
tmp_dir = mktempdir()
5151

5252
open(fn, "r") do fp
53-
untar(fp, abspath(extract_path))
53+
untar(fp, tmp_dir)
5454
end
5555

56-
# mv(joinpath(extract_path, dir_name, "*.*"), joinpath(HERE, "../"), force=true)
56+
# Copy files to destination
57+
# Necessary as Julia's `mv` and `cp` functions
58+
# require empty directories (`force` option deletes an existing directory)
59+
for pfn in readdir(tmp_dir)
60+
open(joinpath(tmp_dir, pfn), "r") do src
61+
open(joinpath(extract_path, pfn), "w") do dst
62+
write(dst, read(src))
63+
end
64+
end
65+
end
5766
end
5867

5968
rm(fn)

0 commit comments

Comments
 (0)