Skip to content

Commit

Permalink
schema: Strip absolute filename
Browse files Browse the repository at this point in the history
Otherwise we potentially pollute `git diff` after `make` with local
builds.
  • Loading branch information
cgwalters authored and openshift-merge-robot committed Mar 5, 2020
1 parent 93c6bd6 commit 9c6f294
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion mantle/build
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,16 @@ schema_generate() {
schema_version="v1"
echo "Generating COSA Schema ${schema_version}"

out="cosa/cosa_${schema_version}.go"
"${GOBIN}/schematyper" \
"../src/schema/${schema_version}.json" \
-o "cosa/cosa_${schema_version}.go" \
-o "${out}.tmp" \
--package="cosa" \
--root-type=Build
# Avoid having a filename in generated code since it
# can vary depending on local checkout paths.
sed -e s,'^// generated by "\(/.*\)/schematyper\(.*\)$,// generated by "schematyper\2,' < "${out}.tmp" > "${out}"
rm -f "${out}.tmp"
}

host_build() {
Expand Down
2 changes: 1 addition & 1 deletion mantle/cosa/cosa_v1.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cosa

// generated by "/src/cosa/mantle/bin/schematyper ../src/schema/v1.json -o cosa/cosa_v1.go --package=cosa --root-type=Build" -- DO NOT EDIT
// generated by "schematyper ../src/schema/v1.json -o cosa/cosa_v1.go.tmp --package=cosa --root-type=Build" -- DO NOT EDIT

type AliyunImage struct {
ImageID string `json:"id"`
Expand Down

0 comments on commit 9c6f294

Please sign in to comment.