Solana Program Template Upgrade Script
This script automates the upgrade of a Solana program project using the create-solana-program tool.
- Argument Configuration:
- Fetches Rust crate and JavaScript package names dynamically.
- Defines arguments for the
create-solana-program command, including program name, address, organization, and client crate/package names.
- Uses
--default and --force flags for the upgrade process.
- Upgrade Process:
- Executes
pnpm create solana-program@latest in the parent directory using the prepared arguments.
- Navigates into the newly created/upgraded program directory.
- Restoration and Dependency Management:
- Stages all changes.
- Restores specific files and folders (defined in
unchangedGlobs) that should not be overwritten by the template.
- Re-installs project dependencies using
pnpm install.