diff --git a/scripts/rename.sh b/scripts/rename.sh index 2875827..c571ae4 100755 --- a/scripts/rename.sh +++ b/scripts/rename.sh @@ -9,6 +9,7 @@ fi IFS='/' read -ra PARTS <<< "$MODULE_NAME" USERNAME="${PARTS[0]}" +REPO="${PARTS[-1]}" # remove all generated proto files find . -type f -name "*.pb.go" -delete @@ -19,6 +20,7 @@ go mod edit -module github.com/$MODULE_NAME find . -not -path './.*' -type f -exec sed -i -e "s,cosmosregistry/example,$MODULE_NAME,g" {} \; find . -name '*.proto' -type f -exec sed -i -e "s,cosmosregistry.example,$(echo "$MODULE_NAME" | tr '/' '.'),g" {} \; find . -name 'protocgen.sh' -type f -exec sed -i -e "s,rm -rf github.com cosmosregistry,rm -rf github.com $USERNAME,g" {} \; +find . -not -path './.*' -type f -exec sed -i -e "s,example,$REPO,g" {} \; # rename directory mkdir -p proto/$MODULE_NAME @@ -28,5 +30,8 @@ rm -rf proto/cosmosregistry # re-generate protos make proto-gen +# credits +echo "# This project was generated using https://github.com/cosmosregistry/example" > THANKS.md + # removes itself rm scripts/rename.sh \ No newline at end of file