@@ -29,7 +29,36 @@ publish_schema() {
29
29
node scripts/yaml2json/yaml2json.js " $target .yaml"
30
30
rm " $target .yaml"
31
31
mv " $target .json" " $target "
32
- echo " * $newestCommitDate : $schema "
32
+
33
+ # Find the jekyll lander markdown file for this iteration.
34
+
35
+ # Define jekyllLander by referencing a markdown file whose name matches the
36
+ # iteration date. This approach would work with today's jekyll landers
37
+ # local jekyllLander=$deploydir/$base/$date.md
38
+
39
+ # Define jekyllLander by referencing a static file
40
+ # local jekyllLander=$deploydir/$base/latest.md
41
+
42
+ # Define jekyllLander by finding the first markdown file already-present in the
43
+ # deploy directory.
44
+ # local jekyllLander=$(find "$deploydir/$base" -maxdepth 1 -name "*.md" | head -n 1)
45
+
46
+ # Define jekyllLander by finding all the markdown files already-present in the
47
+ # deploy directory. If multiple files are present, this script will fail as it
48
+ # attempts to move these multiple files to a single $target.md
49
+ # This behavior is the closest match to that of the previous version of the
50
+ # schema-publish script.
51
+ local jekyllLander=$( find " $deploydir /$base " -maxdepth 1 -name " *.md" )
52
+
53
+ # Move the jekyll lander markdown for this iteration to the deploy destination.
54
+ # The lander files only exist in the gh-pages branch.
55
+ if [ ! -z " $jekyllLander " ]; then
56
+ mv $jekyllLander $target .md
57
+ echo " * $newestCommitDate : $schema & jekyll lander $( basename $jekyllLander ) "
58
+ else
59
+ echo " * $newestCommitDate : $schema "
60
+ fi
61
+
33
62
}
34
63
35
64
echo === Building schemas into $deploydir
0 commit comments