Skip to content

Instantly share code, notes, and snippets.

@hskang9
Created September 15, 2022 00:48
Show Gist options
  • Save hskang9/c038adae21b50596474ff04bd110fad9 to your computer and use it in GitHub Desktop.
Save hskang9/c038adae21b50596474ff04bd110fad9 to your computer and use it in GitHub Desktop.
# Install Cargo contract
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
# Arch Linux
if [ -f "/etc/arch-release" ]; then
pacman -S binaryen
cargo install cargo-dylint dylint-link
cargo install --force --locked cargo-contract
# Debian/Ubuntu
elif [ -f "/etc/debian_version" ]; then
apt-get install -y binaryen
cargo install cargo-dylint dylint-link
cargo install --force --locked cargo-contract
else
echo "Unsupported Linux distribution"
exit 1
fi
elif [[ "$OSTYPE" == "darwin"* ]]; then
# Mac OSX
brew install binaryen
brew install openssl
cargo install cargo-dylint dylint-link
cargo install --force --locked cargo-contract
elif [[ "$OSTYPE" == "msys" ]]; then
# Lightweight shell and GNU utilities compiled for Windows (part of MinGW)
echo "Windows is not supported yet, please install cargo-contract manually in the meantime at https://github.com/paritytech/cargo-contract"
elif [[ "$OSTYPE" == "win32" ]]; then
echo "Windows is not supported yet, please install cargo-contract manually in the meantime at https://github.com/paritytech/cargo-contract"
else
# Unknown.
echo "Installer cannot detect your OS, please install cargo-contract manually in the meantime at https://github.com/paritytech/cargo-contract"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment