File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -155,17 +155,23 @@ object zip {
155155
156156 val fis = if (os.isFile(file)) Some (os.read.inputStream(file)) else None
157157
158- val path = if (os.isDir(file)) sub.toString + " /" else sub.toString
159- try makeZipEntry0(path, fis, mtimeOpt, zipOut)
158+ try makeZipEntry0(sub, fis, mtimeOpt, zipOut)
160159 finally fis.foreach(_.close())
161160 }
162161
163162 private def makeZipEntry0 (
164- path : String ,
163+ sub : os. SubPath ,
165164 is : Option [java.io.InputStream ],
166165 preserveMtimes : Option [Long ],
167166 zipOut : ZipOutputStream
168167 ) = {
168+ val path = is match {
169+ // for folder
170+ case None => sub.toString + " /"
171+ // for file
172+ case Some (_) => sub.toString
173+ }
174+
169175 val zipEntry = new ZipEntry (path)
170176
171177 preserveMtimes match {
You can’t perform that action at this time.
0 commit comments