Skip to content

Commit 1e20be6

Browse files
authored
Merge pull request #5240 from OAI/dev-sync-with-main
2 parents 92e8ec5 + 6998caa commit 1e20be6

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

scripts/schema-publish.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,27 @@ publish_schema() {
4242

4343
# rename or create the jekyll lander markdown file for this iteration
4444
if [ ! -z "$jekyllLander" ]; then
45-
mv $jekyllLander $target.md
46-
echo " * $newestCommitDate: $schema & jekyll lander $(basename $jekyllLander)"
45+
if [ "$jekyllLander" = "$target.md" ]; then
46+
echo " * $base did not change since $date"
47+
else
48+
mv $jekyllLander $target.md
49+
echo " * $base: $date added & jekyll lander moved from $(basename $jekyllLander)"
50+
fi
4751
else
4852
# find the most recent preceding version
4953
local lastdir=""; for fn in $(dirname $deploydir)/?.?; do test "$fn" "<" "$deploydir" && lastdir="$fn"; done
5054
local lastVersion=$(basename $lastdir)
5155
# find the jekyll lander markdown file for the preceding version
52-
local lastLander=$(find "$lastdir/$base" -maxdepth 1 -name "*.md")
56+
local lastLander=$(find "$lastdir/$base" -maxdepth 1 -name "*.md" 2>/dev/null)
5357

5458
if [ ! -z "$lastLander" ]; then
5559
# copy and adjust the lander file from the preceding version
5660
sed "s/$lastVersion/$version/g" $lastLander > $target.md
57-
echo " * $newestCommitDate: $schema & jekyll lander $(basename $lastLander) of $lastVersion"
61+
echo " * $base: $date added & jekyll lander copied from $(basename $lastLander) of $lastVersion"
5862
else
59-
echo " * $newestCommitDate: $schema"
63+
echo " * $base: $date added"
6064
fi
6165
fi
62-
6366
}
6467

6568
echo === Building schemas into $deploydir
@@ -72,7 +75,7 @@ maxDate=""
7275
sedCmds=()
7376
for schema in "${schemas[@]}"; do
7477
if [ -f "$schemaDir/$schema" ]; then
75-
newestCommitDate=$(git log -1 --format="%ad" --date=short "$schemaDir/$schema")
78+
newestCommitDate=$(git log -1 --format="%cd" --date=short "$schemaDir/$schema")
7679

7780
# the newest date across a schema and all its dependencies is its date stamp
7881
if [ "$newestCommitDate" \> "$maxDate" ]; then

0 commit comments

Comments
 (0)