src/main/scala/s3/website/model/push.scala in s3_website-2.11.0 vs src/main/scala/s3/website/model/push.scala in s3_website-2.11.1

- old
+ new

@@ -117,14 +117,14 @@ private[this] def fis(file: File): InputStream = new FileInputStream(file) private[this] def using[T <: Closeable, R](cl: T)(f: (T) => R): R = try f(cl) finally cl.close() } object Files { - def recursiveListFiles(f: File): Seq[File] = { + def recursiveListFiles(maxDepth: Int = Integer.MAX_VALUE)(f: File): Seq[File] = { val these = f.listFiles if (these != null) - these ++ these.filter(_.isDirectory).flatMap(recursiveListFiles) + these ++ these.filter(_.isDirectory).flatMap(recursiveListFiles(maxDepth - 1)) else Nil } def listSiteFiles(implicit site: Site, logger: Logger) = { @@ -135,10 +135,10 @@ val neverUpload = "s3_website.yml" :: ".env" :: Nil map (k => S3Key.build(k, site.config.s3_key_prefix)) val doNotUpload = excludeByConfig || (neverUpload contains s3Key) if (doNotUpload) logger.debug(s"Excluded $s3Key from upload") doNotUpload } - recursiveListFiles(site.rootDirectory) + recursiveListFiles()(site.rootDirectory) .filterNot(_.isDirectory) .filterNot(f => excludeFromUpload(site.resolveS3Key(f))) } }