51 lines
1.2 KiB
Bash
51 lines
1.2 KiB
Bash
#!/usr/bin/env sh
|
|
|
|
echo "[-] Running pre-installation script [-]"
|
|
|
|
{{- if eq .chezmoi.os "linux" }}
|
|
{{- if eq .chezmoi.osRelease.id "alpine" }}
|
|
|
|
echo "Alpine Linux detected"
|
|
{{- else if eq .chezmoi.osRelease.idLike "fedora" }}
|
|
echo "Fedora Linux detected"
|
|
{{- else if (eq .chezmoi.osRelease.id "debian" "ubuntu" "zorin") }}
|
|
|
|
echo "Debian-based Linux detected"
|
|
echo "\n[-] Adding fish package repository [-]"
|
|
|
|
# if fish already installed then skip adding repository
|
|
if test -x /usr/bin/fish; then
|
|
echo "Fish already installed"
|
|
else
|
|
sudo apt-add-repository ppa:fish-shell/release-3
|
|
sudo apt update
|
|
sudo apt install -y fish
|
|
fi
|
|
|
|
{{- else }}
|
|
echo "Linux OS release not recognized"
|
|
exit 1
|
|
{{- end }}
|
|
|
|
{{- else if eq .osid "darwin" }}
|
|
|
|
echo "macOS detected"
|
|
|
|
if test -x /usr/local/bin/brew; then
|
|
echo "Homebrew already installed"
|
|
elif test -x /opt/homebrew/bin/brew; then
|
|
echo "Homebrew already installed"
|
|
else
|
|
echo "\n[-] Installing Homebrew [-]"
|
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
|
fi
|
|
|
|
{{- end }}
|
|
|
|
echo "\n[-] Installing mise [-]"
|
|
if test -x ~/.local/bin/mise; then
|
|
echo "mise already installed"
|
|
else
|
|
curl https://mise.run | sh
|
|
fi
|