Skip to content
This repository was archived by the owner on Jul 14, 2026. It is now read-only.

chore: fix proto script file handling and safety - #977

Open
mdqst wants to merge 1 commit into
neutron-org:mainfrom
mdqst:patch-1
Open

chore: fix proto script file handling and safety#977
mdqst wants to merge 1 commit into
neutron-org:mainfrom
mdqst:patch-1

Conversation

@mdqst

@mdqst mdqst commented Sep 18, 2025

Copy link
Copy Markdown
  • removed unnecessary () around go install … to avoid spawning a useless subshell.
  • rewrote the file loop to safely handle .proto files with spaces or special characters:
    for file in $(find …)find … -print0 | while IFS= read -r -d '' file.
  • updated grep "option go_package" to grep -q "option go_package" "$file" for quiet search and proper quoting.
  • added cd proto || exit 1 to stop the script if the directory doesn’t exist.
  • created the x/ directory before copying files to prevent errors: mkdir -p x.
  • narrowed down rm -rf to only remove the target subdirectory (github.com/neutron-org) instead of the whole github.com.

changes make the script safer, more robust, and prevent accidental deletion or errors when handling files with tricky names.

@mmikev

mmikev commented Nov 11, 2025

Copy link
Copy Markdown
Collaborator

Resolve conflicts, please

Comment thread scripts/protocgen.sh
cd ..

# move proto files to the right places
mkdir -p x

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it makes sense to create the x folder, it must always be here.

Comment thread scripts/protocgen.sh
mkdir -p x
cp -r github.com/neutron-org/neutron/v8/x/* x/
rm -rf github.com
rm -rf github.com/neutron-org

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command will not remove the github.com directory itself, so it doesn't make sense to narrow the command down to neutron-org

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants