File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -79,15 +79,22 @@ object zip {
7979 excludePatterns,
8080 includePatterns,
8181 (path, sub) => {
82- os.copy(path, opened / sub, createFolders = true )
82+ val dest = opened / sub
83+
84+ if (os.isDir(path))
85+ os.makeDir.all(dest)
86+ else
87+ os.copy(path, dest, createFolders = true )
88+
8389 if (! isWin && Runtime .version.feature >= 14 )
84- Files .setPosixFilePermissions((opened / sub).wrapped, os.perms(path).toSet())
90+ Files .setPosixFilePermissions(dest.wrapped, os.perms(path).toSet())
91+
8592 if (! preserveMtimes) {
86- os.mtime.set(opened / sub , 0 )
93+ os.mtime.set(dest , 0 )
8794 // This is the only way we can properly zero out filesystem metadata within the
8895 // Zip file filesystem; `os.mtime.set` is not enough
8996 val view =
90- Files .getFileAttributeView((opened / sub) .wrapped, classOf [BasicFileAttributeView ])
97+ Files .getFileAttributeView(dest .wrapped, classOf [BasicFileAttributeView ])
9198 view.setTimes(FileTime .fromMillis(0 ), FileTime .fromMillis(0 ), FileTime .fromMillis(0 ))
9299 }
93100 }
You can’t perform that action at this time.
0 commit comments