summaryrefslogtreecommitdiff
path: root/script/setup-rust
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2026-03-27 21:15:00 +0100
committerMaze Winther <mazewinther@gmail.com>2026-03-29 15:58:42 +0200
commitd862e56e34ad1a76836cc2716b473a61879f2205 (patch)
treebf7279fe478810fca345567fbf6ed5fa1ffa8603 /script/setup-rust
parentd08fbd73e1d1257d87ed21e85fb4dcfc33c094e1 (diff)
downloadopencut-d862e56e34ad1a76836cc2716b473a61879f2205.tar.gz
feat: init desktop app
Diffstat (limited to 'script/setup-rust')
-rw-r--r--script/setup-rust17
1 files changed, 17 insertions, 0 deletions
diff --git a/script/setup-rust b/script/setup-rust
new file mode 100644
index 00000000..90fffdca
--- /dev/null
+++ b/script/setup-rust
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+
+# Installs the Rust toolchain via rustup.
+# Run this before any platform-specific setup script.
+
+set -euo pipefail
+
+CARGO_BIN="$HOME/.cargo/bin/rustup"
+
+if command -v rustup &> /dev/null || [ -f "$CARGO_BIN" ]; then
+ echo "rustup already installed"
+ exit 0
+fi
+
+echo "Installing rustup..."
+curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
+echo "Rust installed. Reload your shell: source \"\$HOME/.cargo/env\""