Files
dotfiles/install.sh
2025-08-11 21:47:44 +02:00

38 lines
503 B
Bash
Executable File

#!/bin/bash
set -e
DOTFILES_DIR="$HOME/dotfiles"
function arch_setup() {
if ! [ -x "$(which ansible)" ]; then
echo "Installing ansible"
sudo pacman -S ansible
fi
}
function detect_os() {
source /etc/os-release
echo "$ID"
}
local_os=$(detect_os)
case $local_os in
cachyos|arch)
arch_setup
;;
debian)
debian_setup
;;
fedora)
fedora_setup
;;
*)
echo "OS $local_os not supported"
exit 1
esac
ansible-playbook "$DOTFILES_DIR/playbook.yml" "$@"