-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun_once_install-cargo.sh.tmpl
More file actions
47 lines (38 loc) · 1.01 KB
/
run_once_install-cargo.sh.tmpl
File metadata and controls
47 lines (38 loc) · 1.01 KB
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
#!/usr/bin/env bash
set -euo pipefail
log() { echo "[install] $*"; }
# Skip Rust compilation in CI environment
if [ -n "${CI:-}" ]; then
log "CI environment detected. Skipping Rust tools installation."
exit 0
fi
# macOS: Rust tools are installed via Homebrew
if [ "$(uname -s)" = "Darwin" ]; then
log "macOS detected. Rust tools are installed via Homebrew. Skipping."
exit 0
fi
# Rust toolchain
if command -v cargo >/dev/null 2>&1; then
log "cargo is already installed, skipping rustup"
else
log "Installing Rust..."
curl https://sh.rustup.rs -sSf | sh -s -- -y
. "$HOME/.cargo/env"
fi
# Rust tools
if ! command -v sheldon >/dev/null 2>&1; then
log "Installing sheldon..."
cargo install sheldon
fi
if ! command -v eza >/dev/null 2>&1; then
log "Installing eza..."
cargo install eza
fi
if ! command -v starship >/dev/null 2>&1; then
log "Installing starship..."
cargo install starship --locked
fi
if ! command -v atuin >/dev/null 2>&1; then
log "Installing atuin..."
cargo install atuin
fi