chezmoi 新增Debian支援

This commit is contained in:
2025-05-02 16:53:31 +08:00
parent 79d6ecf6b3
commit db6f8611a4
5 changed files with 61 additions and 7 deletions

View File

@@ -1,4 +1,25 @@
{{ if eq .chezmoi.os "linux" -}}
{{/* ---- 安裝腳本 ------------------------------------------------------- */ -}}
{{/* ==== Debian ======================================================== */ -}}
{{ if eq .chezmoi.osRelease.id "debian" -}}
{{/* ---- 整理待安裝清單 -------------------------------------------------- */ -}}
{{- $aptInstall := .packages.linux.debian.apt -}}
apt_packages=( {{ $aptInstall | quoteList | join " " }} )
to_install_apt=()
for package in "${apt_packages[@]}"; do
to_install_apt+=("$package")
done
echo " - Installing packages via apt: ${to_install_apt[@]}"
if [ "$EUID" -ne 0 ]
sudo apt install -y "${to_install_apt[@]}"
else
apt install -y "${to_install_apt[@]}"
fi
{{ end -}}
{{/* ==== Arch Linux / Manjaro ========================================== */ -}}