This commit is contained in:
MangoPig 2025-12-03 06:20:16 +00:00
parent 4ac11a8dd4
commit 4806f7a6b7

View File

@ -132,45 +132,31 @@ fi
# Install NVM, GVM, Rustup
echo -e "${BLUE} LOG:${YELLOW} Installing NVM, GVM and Rustup...${NC}"
# 1. Setup Node (LTS + Global Tools)
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # Load NVM
# NVM
if [ ! -d "$HOME/.nvm" ]; then
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
fi
if command -v nvm &> /dev/null; then
echo -e "${BLUE} LOG:${YELLOW} Installing Node LTS...${NC}"
nvm install --lts
nvm use --lts
echo -e "${BLUE} LOG:${YELLOW} Installing Global Node Packages (pnpm, yarn)...${NC}"
npm install -g pnpm yarn
# Go and GVM
wget https://go.dev/dl/go1.25.4.linux-amd64.tar.gz -O /tmp/go1.25.4.linux-amd64.tar.gz
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf /tmp/go1.25.4.linux-amd64.tar.gz
rm -f /tmp/go1.25.4.linux-amd64.tar.gz
if [ ! -d "$HOME/.gvm" ]; then
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
fi
# 2. Setup Go (Bootstrap + Target)
[[ -s "$HOME/.gvm/scripts/gvm" ]] && source "$HOME/.gvm/scripts/gvm" # Load GVM
TARGET_GO="go1.25.5"
if command -v gvm &> /dev/null; then
# Bootstrap check
if ! command -v go &> /dev/null; then
echo -e "${BLUE} LOG:${YELLOW} Bootstrapping Go...${NC}"
gvm install go1.24.0 -B
gvm use go1.24.0
fi
# Install Target
if [[ $(gvm list) != *"$TARGET_GO"* ]]; then
echo -e "${BLUE} LOG:${YELLOW} Installing Target Go ($TARGET_GO)...${NC}"
gvm install $TARGET_GO
gvm use $TARGET_GO --default
fi
# Rustup
if ! command -v rustup &> /dev/null; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
fi
# 3. Setup Rust (Stable Default)
if command -v rustup &> /dev/null; then
echo -e "${BLUE} LOG:${YELLOW} Setting Rust to stable...${NC}"
rustup default stable
rustup update
# Install Eza with Cargo
echo -e "${BLUE} LOG:${YELLOW} Installing Eza via Cargo...${NC}"
if ! command -v eza &> /dev/null; then
source "$HOME/.cargo/env"
cargo install eza
fi
# ---------------------------------------------------------------------
@ -229,6 +215,18 @@ echo -e "${BLUE} LOG:${YELLOW} Stowing dotfiles...${NC}"
cd "$DOTFILES_DIR"
stow . --target="$HOME" --ignore="setup.sh" --ignore=".git" --ignore=".gitignore" --ignore="README.md" --ignore=".zsh_secrets" --ignore=".zsh_secrets.example" --ignore="LICENSE" --ignore="Makefile" --ignore="provision.sh"
# Language Installation
echo -e "${BLUE} LOG:${YELLOW} Installing languages and tools...${NC}"
gvm install go1.25.5
gvm use go1.25.5 --default
nvm install --lts
nvm use --lts
rustup default stable
rustup update
# Finish
echo -e "${GREEN} LOG: Setup Complete! Please restart your terminal to apply all changes.${NC}"
echo -e "${GREEN} You may need to log out and back in for Docker group changes to take effect.${NC}"