Skip to content

Commit 740c675

Browse files
committed
allow file names with .
1 parent 0a0f924 commit 740c675

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/FileDFG/services/FileDFG.jl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,21 @@ function loadDFG(dst::String, iifModule, dfgLoadInto::G; loaddir=joinpath("/","t
8181
dstname = dst # path name could either be legacy FileDFG dir or .tar.gz file of FileDFG files.
8282
unzip = false
8383
# add if doesn't have .tar.gz extension
84+
lastdirname = splitpath(dstname)[end]
8485
if !isdir(dst)
8586
unzip = true
86-
sdst = split(folder, '.')
87-
if length(sdst) == 1 && sdst[end] != "gz"
87+
sdst = split(lastdirname, '.')
88+
if sdst[end] != "gz" # length(sdst) == 1 &&
8889
dstname *= ".tar.gz"
90+
lastdirname *= ".tar.gz"
8991
end
9092
end
9193
# do actual unzipping
9294
if unzip
93-
sfolder = split(dstname, '.')
95+
@show sfolder = split(dstname, '.')
9496
Base.mkpath(loaddir)
95-
folder = joinpath(loaddir, splitpath(string(sfolder[end-2]))[end] )
96-
@info "loadDF detected a gzip $dstname -- unpacking via $loaddir now..."
97+
folder = joinpath(loaddir, lastdirname[1:(end-length(".tar.gz"))]) #splitpath(string(sfolder[end-2]))[end]
98+
@info "loadDFG detected a gzip $dstname -- unpacking via $loaddir now..."
9799
Base.rm(folder, recursive=true, force=true)
98100
# unzip the tar file
99101
run(`tar -zxf $dstname -C $loaddir`)

0 commit comments

Comments
 (0)