Skip to content

Commit

Permalink
tmp: debug proto gen
Browse files Browse the repository at this point in the history
  • Loading branch information
amimart committed Jan 17, 2024
1 parent be741a3 commit 0eebafc
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions scripts/protocgen-code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,26 @@
set -eo pipefail

echo "Generating gogo proto code"
(
cd proto
proto_dirs=$(find . -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
for dir in $proto_dirs; do
# shellcheck disable=SC2044
for file in $(find "${dir}" -maxdepth 1 -name '*.proto'); do
if grep "option go_package" "${file}" &> /dev/null ; then
buf generate --template buf.gen.gogo.yml "${file}"
fi
done
echo "------------PWD: $PWD"
cd proto
echo "------------PWD: $PWD"
proto_dirs=$(find . -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
for dir in $proto_dirs; do
echo "------------IN DIR $dir"
# shellcheck disable=SC2044
for file in $(find "${dir}" -maxdepth 1 -name '*.proto'); do
echo "------------IN FILE $file"
if grep "option go_package" "${file}" &> /dev/null ; then
echo "------------BUF GEN $file"
buf generate --template buf.gen.gogo.yml "${file}"
ls -l
fi
done
)

DST="${PWD}/x"
(
cd github.com/okp4/okp4d/x
find . -type f -name "*.go" -exec mv {} "${DST}/{}" \;
)
done
ls -l
cd ..
echo "------------LS"
ls -l
echo "------------PWD: $PWD"
cp -r github.com/okp4/okp4d/* ./
rm -rf github.com

0 comments on commit 0eebafc

Please sign in to comment.