mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-26 11:14:08 +00:00
32 lines
749 B
Bash
32 lines
749 B
Bash
#!/usr/bin/env bash
|
|
# run_once_before script to install prerequisites
|
|
# This runs once before applying dotfiles
|
|
|
|
set -e
|
|
|
|
echo "→ Installing prerequisites..."
|
|
|
|
{{- if .is_macos }}
|
|
# Install Homebrew if not present
|
|
if ! command -v brew &> /dev/null; then
|
|
echo "→ Installing Homebrew..."
|
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
|
fi
|
|
|
|
# Install Xcode CLI tools if needed
|
|
if ! xcode-select -p &> /dev/null; then
|
|
echo "→ Installing Xcode Command Line Tools..."
|
|
xcode-select --install || true
|
|
fi
|
|
{{- end }}
|
|
|
|
{{- if .is_linux }}
|
|
# Update package manager
|
|
if command -v apt &> /dev/null; then
|
|
echo "→ Updating apt..."
|
|
sudo apt update
|
|
fi
|
|
{{- end }}
|
|
|
|
echo "✓ Prerequisites installed!"
|