add declarative package list and installer, improve shell scripts

This commit is contained in:
2024-03-27 18:25:20 -06:00
parent 24cf6e41af
commit d74c8441c2
4 changed files with 149 additions and 41 deletions

View File

@@ -0,0 +1,47 @@
#!/usr/bin/env sh
# .chezmoidata/packages.yaml hash: {{ include ".chezmoidata/packages.yaml" | sha256sum }}
echo "[-] Updating packages [-]"
{{- if eq .chezmoi.os "linux" }}
{{- if eq .chezmoi.osRelease.id "alpine" }}
echo "[-] Updating APK packages [-]"
apk update
{{ range .packages.linux.apks -}}
apk add {{ . | quote }}
{{ end -}}
{{- else if (eq .chezmoi.osRelease.id "debian" "ubuntu" "zorin") }}
echo "[-] Updating Apt packages [-]"
sudo apt update
{{ range .packages.linux.apts -}}
sudo apt install -y {{ . | quote }}
{{ end -}}
{{ end -}}
{{- else if eq .osid "darwin" }}
echo "[-] Updating brews [-]"
{{ range .packages.darwin.brews -}}
brew install {{ . | quote }}
{{ end -}}
{{ end -}}
echo "[-] Updating Webman groups [-]"
if test -x ~/.webman/bin/webman; then
echo "webman already installed"
else
echo "\n[-] Installing webman [-]"
curl https://raw.githubusercontent.com/candrewlee14/webman/main/scripts/install.sh | sh
fi
~/.webman/bin/webman upgrade webman
{{ range .packages.webman.groups -}}
~/.webman/bin/webman group upgrade {{ . | quote }} -a
{{ end -}}
echo "[-] Updating Webman packages [-]"
{{ range .packages.webman.pkgs -}}
~/.webman/bin/webman upgrade {{ . | quote }}
{{ end -}}