Skip to content

Commit 0a26553

Browse files
use arg_mkdir to handle directory creation (#60)
1 parent af9333f commit 0a26553

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ArgTools = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
88
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
99

1010
[compat]
11-
ArgTools = "1"
11+
ArgTools = "1.1"
1212
julia = "1.3"
1313

1414
[extras]

src/Tar.jl

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -171,27 +171,12 @@ function extract(
171171
check_extract_tarball(tarball)
172172
check_extract_dir(dir)
173173
arg_read(tarball) do tar
174-
if dir !== nothing && ispath(dir)
174+
arg_mkdir(dir) do dir
175175
arg_write(skeleton) do skeleton
176176
extract_tarball(predicate, tar, dir, skeleton=skeleton)
177177
end
178-
else
179-
if dir === nothing
180-
dir = mktempdir()
181-
else
182-
mkdir(dir)
183-
end
184-
try arg_write(skeleton) do skeleton
185-
extract_tarball(predicate, tar, dir, skeleton=skeleton)
186-
end
187-
catch
188-
chmod(dir, 0o700, recursive=true)
189-
rm(dir, force=true, recursive=true)
190-
rethrow()
191-
end
192178
end
193179
end
194-
return dir::AbstractString
195180
end
196181

197182
function extract(

0 commit comments

Comments
 (0)