-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_dev_environment.sh
More file actions
executable file
·51 lines (42 loc) · 1.53 KB
/
setup_dev_environment.sh
File metadata and controls
executable file
·51 lines (42 loc) · 1.53 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
47
48
49
50
51
#!/bin/bash
set -e
echo "==========================================="
echo " Bootstrapping TensorPlane Dev Environment"
echo "==========================================="
# 1. Check for and install mise
if ! command -v mise &> /dev/null; then
echo "=> 'mise' not found. Downloading and installing..."
curl https://mise.run | sh
# Hook into .bashrc if not already present
if ! grep -q "mise activate bash" ~/.bashrc; then
echo 'eval "$(~/.local/bin/mise activate bash)"' >> ~/.bashrc
echo "=> Added mise hook to ~/.bashrc"
fi
# Temporarily add to PATH so the rest of this script works
export PATH="$HOME/.local/bin:$PATH"
else
echo "=> 'mise' is already installed."
fi
# 2. Activate mise for the current script session
eval "$(mise activate bash)"
# 3. Trust the local mise.toml file (solves the untrusted config error)
echo "=> Trusting the local repository configuration..."
mise trust
# 4. Install the exact toolchains (Go 1.22, Rust stable)
echo "=> Installing Go and Rust toolchains..."
mise install
# 5. Fetch project dependencies using the Makefile we created earlier
if [ -f "Makefile" ]; then
echo "=> Fetching Go and Rust package dependencies..."
make deps
else
echo "=> Makefile not found. Skipping 'make deps'."
fi
echo "==========================================="
echo " Setup Complete! "
echo " "
echo " IMPORTANT: Run the following command to "
echo " update your current terminal session: "
echo " "
echo " source ~/.bashrc "
echo "==========================================="