Skip to content

Commit 5ba8fba

Browse files
committed
fixup! Update schema-publish.sh
1 parent b197fd5 commit 5ba8fba

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

scripts/schema-publish.sh

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,36 @@ publish_schema() {
2929
node scripts/yaml2json/yaml2json.js "$target.yaml"
3030
rm "$target.yaml"
3131
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+
3362
}
3463

3564
echo === Building schemas into $deploydir

0 commit comments

Comments
 (0)