Skip to content

Commit

Permalink
use p7zip_jll
Browse files Browse the repository at this point in the history
  • Loading branch information
nhz2 committed Apr 19, 2024
1 parent 2ab96aa commit d3736d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
ZipArchives = "49080126-0e18-4c2a-b176-c102e4b3760c"
p7zip_jll = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"

[weakdeps]
DataPipeline = "9ced6f0a-eb77-43a8-bbd1-bbf3031b0d12"
Expand Down Expand Up @@ -95,7 +95,7 @@ StatsBase = "0.32.2, 0.33, 0.34"
Test = "1.9"
UUIDs = "1.9"
Unitful = "1.7"
ZipArchives = "2"
p7zip_jll = "17"
julia = "1.9"

[extras]
Expand Down
15 changes: 2 additions & 13 deletions ext/EcoSISTEMDataPipelineExt.jl
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
module EcoSISTEMDataPipelineExt

using EcoSISTEM
using ZipArchives
import p7zip_jll

@info "Creating data pipeline interface for EcoSISTEM..."

function EcoSISTEM.unziptemp(path::String)
zr = ZipReader(read(open(path)))
newpath = mktempdir()
files = zip_names(zr)
for file in files
if zip_isdir(zr, file)
mkdir(joinpath(newpath, file))
end
end
for file in files
if !zip_isdir(zr, file)
write(joinpath(newpath, file), zip_readentry(zr, file, String))
end
end
run(`$(p7zip_jll.p7zip()) x -tzip -y -o$(newpath) $(path)`)
@debug "Unzipped to $newpath"
return newpath
end
Expand Down

0 comments on commit d3736d4

Please sign in to comment.