split after script to before and after

This commit is contained in:
2024-03-27 19:21:51 -06:00
parent bfb3b5ee9b
commit 5dad2e9bec
2 changed files with 72 additions and 18 deletions

View File

@@ -0,0 +1,46 @@
#!/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.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"
else
echo "\n[-] Installing Homebrew [-]"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
{{- end }}
echo "\n[-] Installing webman [-]"
if test -x ~/.webman/bin/webman; then
echo "webman already installed"
else
curl https://raw.githubusercontent.com/candrewlee14/webman/main/scripts/install.sh | sh
fi