File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1717publish_schema () {
1818 local schema=" $1 "
1919 local date=" $2 "
20+ local sedCmd=" $3 "
2021
2122 local base=$( basename $schema ' .yaml' )
2223 local target=$deploydir /$base /$date
2324
2425 mkdir -p $deploydir /$base
25- # replace the WORK-IN-PROGRESS placeholder
26- sed -e " s/ ${base} \\ /WORK-IN-PROGRESS/ ${base} \\ / ${date} /g " $schemaDir /$schema > $target .yaml
26+ # replace the WORK-IN-PROGRESS placeholders
27+ sed -e $sedCmd $schemaDir /$schema > $target .yaml
2728
2829 node scripts/yaml2json/yaml2json.js " $target .yaml"
2930 rm " $target .yaml"
@@ -38,6 +39,7 @@ schemas=(meta.yaml dialect.yaml schema.yaml schema-base.yaml)
3839
3940# publish each schema using its or any of its dependencies newest commit date.
4041maxDate=" "
42+ sedCmds=()
4143for schema in " ${schemas[@]} " ; do
4244 if [ -f " $schemaDir /$schema " ]; then
4345 newestCommitDate=$( git log -1 --format=" %ad" --date=short " $schemaDir /$schema " )
@@ -47,7 +49,11 @@ for schema in "${schemas[@]}"; do
4749 maxDate=$newestCommitDate
4850 fi
4951
50- publish_schema " $schema " " $maxDate "
52+ base=$( basename $schema ' .yaml' )
53+ # Add the replacement for this schema's placeholder to list of sed commands.
54+ sedCmds+=(" s/${base} \/WORK-IN-PROGRESS/${base} \/${maxDate} /g" )
55+
56+ publish_schema " $schema " " $maxDate " $( printf ' %s;' " ${sedCmds[@]} " )
5157 fi
5258done
5359
You can’t perform that action at this time.
0 commit comments