Skip to content

Commit edcd432

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

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

scripts/schema-publish.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ schemaDir="src/schemas/validation"
88
branch=$(git branch --show-current)
99

1010
if [[ $branch =~ ^v([0-9]+\.[0-9]+\.[0-9]+) ]]; then
11-
deploydir="./deploy/oas/${BASH_REMATCH[1]}"
11+
version=${BASH_REMATCH[1]}
12+
deploydir="./deploy/oas/${version}"
1213
else
14+
version=""
1315
deploydir="./deploy-preview"
1416
fi
1517

@@ -21,6 +23,7 @@ publish_schema() {
2123

2224
local base=$(basename $schema '.yaml')
2325
local target=$deploydir/$base/$date
26+
local jekyllLander=$base/$version.md
2427

2528
mkdir -p $deploydir/$base
2629
# replace the WORK-IN-PROGRESS placeholders
@@ -29,6 +32,13 @@ publish_schema() {
2932
node scripts/yaml2json/yaml2json.js "$target.yaml"
3033
rm "$target.yaml"
3134
mv "$target.json" "$target"
35+
36+
# Move the jekyll lander markdown for this iteration to the deploy destination.
37+
# The lander files only exist in the gh-pages branch.
38+
if [ -f "$jekyllLander" ]; then
39+
mv $jekyllLander $target.md
40+
fi
41+
3242
echo " * $newestCommitDate: $schema"
3343
}
3444

0 commit comments

Comments
 (0)