Last active
May 25, 2025 07:57
-
-
Save unmaykr-aftermath/56edd0fbcdef0fc52c8f7ca490dbbf03 to your computer and use it in GitHub Desktop.
Automatically rename AF crates that were migrated
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
rename-crates () | |
{ | |
FROM=$1 | |
TO=$2 | |
FROM_SNAKE=$(echo $FROM | sed "s/-/_/g") | |
TO_SNAKE=$(echo $TO | sed "s/-/_/g") | |
sed -i -E "s/$FROM/$TO/g" $(find . -name "*.toml") | |
sed -i -E "s/$FROM_SNAKE/$TO_SNAKE/g" $(find . -name "*.rs") | |
} | |
rename-crates pyth-client pyth-hermes-client | |
rename-crates sui-graphql-client sui-gql-client | |
rename-crates sui-graphql-schema sui-gql-schema | |
cargo test && git commit -am " | |
fix: rename deprecated crates | |
Used: | |
https://gist.github.com/unmaykr-aftermath/56edd0fbcdef0fc52c8f7ca490dbbf03" |
Make sure to be running the latest versions of our packages first:
https://github.com/AftermathFinance/cargo-workspace-template/blob/main/scripts/bump_af_deps_breaking.sh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use this with
curl -s https://gist.githubusercontent.com/unmaykr-aftermath/56edd0fbcdef0fc52c8f7ca490dbbf03/raw/f0f7d2da6ae3fa6a73135f37bf180ed6b99e6cc2/rename-af-crates.sh \ | bash