Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

mdqst
Copy link

@mdqst mdqst commented Sep 18, 2025

  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant