Last active
January 8, 2020 16:33
-
-
Save lamafab/5abaff261e92a2ff1e3c68c5eb2bd823 to your computer and use it in GitHub Desktop.
[W3F HQ] Script to update and run Polkadot
This file contains 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
#!/bin/bash | |
# This script assumes that Polkadot is cloned in the relative path `polkadot/` | |
# and the file `run_kusama.sh` (which actually executes the program) is present. | |
# | |
# Example usage: `$ ./update_kusama.sh v0.7.15` | |
print_error () { | |
echo -e "\e[41m[!!]\e[0m Please specify a valid git tag" | |
echo "Example command:" | |
echo "$ ./update_kusama.sh v0.7.15" | |
exit 1 | |
} | |
# Check if the git tag was set as an argument | |
if [ -z "$1" ] | |
then | |
print_error | |
fi | |
# Pull the newest releases | |
cd polkadot/ | |
git checkout master | |
git pull origin master --tags | |
# Checkout the specified tag, exit if it does not exist | |
git checkout $1 | |
if [ ! $? -eq 0 ]; then | |
echo "" | |
print_error | |
fi | |
# Finally build and execute | |
cargo build --release | |
cd .. | |
./run_kusama.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment