2024-12-31 11:04:01 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
set -euxo pipefail
|
|
|
|
|
|
2025-01-19 17:05:23 +08:00
|
|
|
# Check if sudo is available
|
|
|
|
|
if command -v sudo >/dev/null 2>&1; then
|
|
|
|
|
sudo apt-get update
|
2025-08-19 16:44:11 -07:00
|
|
|
sudo apt-get install -y libssl-dev pkg-config protobuf-compiler
|
2025-01-19 17:05:23 +08:00
|
|
|
else
|
|
|
|
|
apt-get update
|
2025-08-19 16:44:11 -07:00
|
|
|
apt-get install -y libssl-dev pkg-config protobuf-compiler
|
2025-01-19 17:05:23 +08:00
|
|
|
fi
|
2024-11-04 10:56:52 -08:00
|
|
|
|
|
|
|
|
# Install rustup (Rust installer and version manager)
|
|
|
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Follow the installation prompts, then reload your shell
|
2024-11-06 21:46:04 +08:00
|
|
|
. "$HOME/.cargo/env"
|
2024-11-04 10:56:52 -08:00
|
|
|
source $HOME/.cargo/env
|
|
|
|
|
|
|
|
|
|
# Verify installation
|
|
|
|
|
rustc --version
|
2024-11-06 21:46:04 +08:00
|
|
|
cargo --version
|
2025-08-19 16:44:11 -07:00
|
|
|
protoc --version
|