Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Jul 3, 2023
1 parent 437d499 commit 5ff3497
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/rename.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

0 comments on commit 5ff3497

Please sign in to comment.