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 17
17
publish_schema () {
18
18
local schema=" $1 "
19
19
local date=" $2 "
20
+ local sedCmd=" $3 "
20
21
21
22
local base=$( basename $schema ' .yaml' )
22
23
local target=$deploydir /$base /$date
23
24
24
25
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
27
28
28
29
node scripts/yaml2json/yaml2json.js " $target .yaml"
29
30
rm " $target .yaml"
@@ -38,6 +39,7 @@ schemas=(meta.yaml dialect.yaml schema.yaml schema-base.yaml)
38
39
39
40
# publish each schema using its or any of its dependencies newest commit date.
40
41
maxDate=" "
42
+ sedCmds=()
41
43
for schema in " ${schemas[@]} " ; do
42
44
if [ -f " $schemaDir /$schema " ]; then
43
45
newestCommitDate=$( git log -1 --format=" %ad" --date=short " $schemaDir /$schema " )
@@ -47,7 +49,11 @@ for schema in "${schemas[@]}"; do
47
49
maxDate=$newestCommitDate
48
50
fi
49
51
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[@]} " )
51
57
fi
52
58
done
53
59
You can’t perform that action at this time.
0 commit comments