Move protofiles generated into v2 directory

Protobuf will automatically put the files generated for a v2 module into
a v2 directory. Move them to their correct location after running the
protobuild.

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan 2023-10-27 15:44:23 -07:00
parent 638b474c81
commit ddd73ad300
No known key found for this signature in database
GPG Key ID: F58C5D0A4405ACDB

View File

@ -179,8 +179,9 @@ protos: bin/protoc-gen-go-fieldpath
@mv ${ROOTDIR}/vendor ${TMPDIR}
@(cd ${ROOTDIR}/api && PATH="${ROOTDIR}/bin:${PATH}" protobuild --quiet ${API_PACKAGES})
@(PATH="${ROOTDIR}/bin:${PATH}" protobuild --quiet ${NON_API_PACKAGES})
find v2 -name '*.pb.go' -exec sh -c 'f={}; mkdir -p $$(dirname "$${f#v2/}"); echo mv $$f $${f#v2/}; mv $$f $${f#v2/}' \;
@mv ${TMPDIR}/vendor ${ROOTDIR}
@rm -rf ${TMPDIR}
@rm -rf ${TMPDIR} v2
go-fix-acronym -w -a '(Id|Io|Uuid|Os)$$' $(shell find api/ runtime/ -name '*.pb.go')
check-protos: protos ## check if protobufs needs to be generated again