s3_website 2.11.1 → 2.11.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92d89f42b813e2ab6e76df4a90e610446855d04a
|
4
|
+
data.tar.gz: ccd002dff60a5e0fe3fe2f267e8f54dc097b70ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 805cf02a27b76ffcc325f042fa36a418517248283f65f4763a522736659c85cbf27ebf77de97248cc994ee2ff4c72eb7141187ff96c60145304e65727a2e660d
|
7
|
+
data.tar.gz: 269d27d08c42d22af52e521b35a9eb8f6189d01b5a662769d24748c4ebb79b7531b2cae29e14657872fe0e92545d946992e46079433ef133837ece79001b68d1
|
data/changelog.md
CHANGED
data/lib/s3_website/version.rb
CHANGED
@@ -101,7 +101,7 @@ object Site {
|
|
101
101
|
| site: dist/website""".stripMargin
|
102
102
|
|
103
103
|
def resolveSiteDir(implicit yamlConfig: S3_website_yml, config: Config, cliArgs: CliArgs, workingDirectory: File): Either[ErrorReport, File] = {
|
104
|
-
val siteFromAutoDetect = autodetectSiteDir(workingDirectory)
|
104
|
+
val siteFromAutoDetect = if (config.site.isEmpty) { autodetectSiteDir(workingDirectory) } else { None }
|
105
105
|
val errOrSiteFromCliArgs: Either[ErrorReport, Option[File]] = Option(cliArgs.site) match {
|
106
106
|
case Some(siteDirFromCliArgs) =>
|
107
107
|
val f = new File(siteDirFromCliArgs)
|
@@ -119,10 +119,10 @@ object Upload {
|
|
119
119
|
}
|
120
120
|
|
121
121
|
object Files {
|
122
|
-
def recursiveListFiles(
|
122
|
+
def recursiveListFiles(f: File): Seq[File] = {
|
123
123
|
val these = f.listFiles
|
124
124
|
if (these != null)
|
125
|
-
these ++ these.filter(_.isDirectory).flatMap(recursiveListFiles
|
125
|
+
these ++ these.filter(_.isDirectory).flatMap(recursiveListFiles)
|
126
126
|
else
|
127
127
|
Nil
|
128
128
|
}
|
@@ -137,7 +137,7 @@ object Files {
|
|
137
137
|
if (doNotUpload) logger.debug(s"Excluded $s3Key from upload")
|
138
138
|
doNotUpload
|
139
139
|
}
|
140
|
-
recursiveListFiles(
|
140
|
+
recursiveListFiles(site.rootDirectory)
|
141
141
|
.filterNot(_.isDirectory)
|
142
142
|
.filterNot(f => excludeFromUpload(site.resolveS3Key(f)))
|
143
143
|
}
|
@@ -11,10 +11,8 @@ trait Ssg {
|
|
11
11
|
object Ssg {
|
12
12
|
val automaticallySupportedSiteGenerators = Jekyll :: Nanoc :: Nil
|
13
13
|
|
14
|
-
val maxAutodetectDepth = automaticallySupportedSiteGenerators.map(_.outputDirectory).map(_.split(File.separatorChar).length).max
|
15
|
-
|
16
14
|
def autodetectSiteDir(workingDirectory: File): Option[File] =
|
17
|
-
recursiveListFiles(
|
15
|
+
recursiveListFiles(workingDirectory).find { file =>
|
18
16
|
file.isDirectory && automaticallySupportedSiteGenerators.exists(ssg => file.getAbsolutePath.endsWith(ssg.outputDirectory))
|
19
17
|
}
|
20
18
|
}
|