forked from solana-labs/solana-program-library
-
Notifications
You must be signed in to change notification settings - Fork 1
/
update-solana-dependencies.sh
executable file
·50 lines (44 loc) · 1.12 KB
/
update-solana-dependencies.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env bash
#
# Updates the solana version in all the SPL crates
#
solana_ver=$1
if [[ -z $solana_ver ]]; then
echo "Usage: $0 <new-solana-version>"
exit 1
fi
cd "$(dirname "$0")"
source ./ci/solana-version.sh
old_solana_ver=${solana_version#v}
sed -i'' -e "s#solana_version=v.*#solana_version=v${solana_ver}#" ./ci/solana-version.sh
sed -i'' -e "s#solana_version = \".*\"#solana_version = \"${solana_ver}\"#" ./Anchor.toml
declare tomls=()
while IFS='' read -r line; do tomls+=("$line"); done < <(find . -name Cargo.toml)
crates=(
solana-account-decoder
solana-banks-client
solana-banks-server
solana-bpf-loader-program
solana-clap-utils
solana-cli-config
solana-cli-output
solana-client
solana-core
solana-logger
solana-notifier
solana-program
solana-program-test
solana-remote-wallet
solana-runtime
solana-sdk
solana-stake-program
solana-test-validator
solana-transaction-status
solana-vote-program
solana-version
solana-zk-token-sdk
)
set -x
for crate in "${crates[@]}"; do
sed -E -i'' -e "s:(${crate} = \")(=?)${old_solana_ver}\".*:\1\2${solana_ver}\":" "${tomls[@]}"
done