File tree Expand file tree Collapse file tree
main/scala/com/typesafe/sbt/packager/universal
test/scala/com/typesafe/sbt/packager/universal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,17 +109,19 @@ object ZipHelper {
109109 val outputDir = outputFile.getParentFile
110110 IO createDirectory outputDir
111111 withZipOutput(outputFile) { output =>
112- for (FileMapping (file, name, mode) <- sources; if ! file.isDirectory ) {
112+ for (FileMapping (file, name, mode) <- sources) {
113113 val entry = new ZipArchiveEntry (file, normalizePath(name))
114114 // Now check to see if we have permissions for this sucker.
115115 mode foreach (entry.setUnixMode)
116116 output putArchiveEntry entry
117- val fis = new java.io.FileInputStream (file)
118- try try
119- // TODO - Write file into output?
120- IOUtils .copy(fis, output)
121- finally output.closeArchiveEntry()
122- finally fis.close()
117+
118+ try if (file.isFile) {
119+ val fis = new java.io.FileInputStream (file)
120+ try
121+ // TODO - Write file into output?
122+ IOUtils .copy(fis, output)
123+ finally fis.close()
124+ } finally output.closeArchiveEntry()
123125 }
124126 }
125127 }
Original file line number Diff line number Diff line change @@ -31,8 +31,7 @@ class ZipHelperSpec extends WordSpec with Matchers with BeforeAndAfterEach with
3131 zipSingleFile(ZipHelper .zip)
3232 }
3333
34- // ignores empty directories
35- " create a zip with nested directories" taggedAs (LinuxTag , WindowsTag ) ignore {
34+ " create a zip with nested directories" taggedAs (LinuxTag , WindowsTag ) in {
3635 zipNestedFile(ZipHelper .zip)
3736 }
3837
You can’t perform that action at this time.
0 commit comments