Skip to content

Commit

Permalink
More intuitive variable name, more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfhandl committed Oct 29, 2024
1 parent d687024 commit 6d04eeb
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions scripts/schema-publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,22 @@ for schemaDir in schemas/v3* ; do
version=${vVersion:1}
echo $version

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

# find the latest commit date for each schema
# find the newest commit date for each schema
maxDate=""
declare -A datesHash
for schema in "${schemas[@]}"; do
if [ -f "$schemaDir/$schema" ]; then
lastCommitDate=$(git log -1 --format="%ad" --date=short "$schemaDir/$schema")
if [ "$lastCommitDate" \> "$maxDate" ]; then
maxDate=$lastCommitDate
newestCommitDate=$(git log -1 --format="%ad" --date=short "$schemaDir/$schema")

# the newest date across a schema and all its dependencies is its date stamp
if [ "$newestCommitDate" \> "$maxDate" ]; then
maxDate=$newestCommitDate
fi
datesHash["$schema"]=$maxDate
echo $schema changed at $lastCommitDate
echo $schema changed at $newestCommitDate
fi
done

Expand Down

0 comments on commit 6d04eeb

Please sign in to comment.