Skip to content

Commit 6d04eeb

Browse files
committed
More intuitive variable name, more comments
1 parent d687024 commit 6d04eeb

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

scripts/schema-publish.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,22 @@ for schemaDir in schemas/v3* ; do
99
version=${vVersion:1}
1010
echo $version
1111

12+
# list of schemas to process, dependent schemas come first
1213
schemas=(meta.yaml dialect.yaml schema.yaml schema-base.yaml)
1314

14-
# find the latest commit date for each schema
15+
# find the newest commit date for each schema
1516
maxDate=""
1617
declare -A datesHash
1718
for schema in "${schemas[@]}"; do
1819
if [ -f "$schemaDir/$schema" ]; then
19-
lastCommitDate=$(git log -1 --format="%ad" --date=short "$schemaDir/$schema")
20-
if [ "$lastCommitDate" \> "$maxDate" ]; then
21-
maxDate=$lastCommitDate
20+
newestCommitDate=$(git log -1 --format="%ad" --date=short "$schemaDir/$schema")
21+
22+
# the newest date across a schema and all its dependencies is its date stamp
23+
if [ "$newestCommitDate" \> "$maxDate" ]; then
24+
maxDate=$newestCommitDate
2225
fi
2326
datesHash["$schema"]=$maxDate
24-
echo $schema changed at $lastCommitDate
27+
echo $schema changed at $newestCommitDate
2528
fi
2629
done
2730

0 commit comments

Comments
 (0)