Skip to content

Commit

Permalink
feat: add Ubuntu support
Browse files Browse the repository at this point in the history
  • Loading branch information
vicnett committed Nov 18, 2024
1 parent 4e327ff commit aec82a0
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,32 @@ DOTFILES_DIR="$HOME/.dotfiles"
ANSIBLE_PATH="$HOME/.local/bin"
PLAYBOOK_PATH="$DOTFILES_DIR/ansible/playbook.yml"

sudo pacman -S --needed --noconfirm git python-pipx
pipx install --include-deps ansible
# Detect distro
if [ -f /etc/os-release ]; then
# freedesktop.org and systemd
. /etc/os-release
OS=$NAME
fi

if [ ! -d $DOTFILES_DIR ]
if [ "$OS" = "Manjaro Linux" ]; then
sudo pacman -S --needed --noconfirm git python-pipx
elif [ "$OS" = "Ubuntu" ]; then
sudo apt --assume-yes install git python-pipx
else
echo "Distribution $OS not supported"
exit 1
fi

pipx install --include-deps ansible
if [ ! -d "$DOTFILES_DIR" ]
then
git clone --recurse-submodules https://github.com/vicnett/dotfiles.git $DOTFILES_DIR
git clone --recurse-submodules https://github.com/vicnett/dotfiles.git "$DOTFILES_DIR"
fi

if [ -f $PLAYBOOK_PATH ]
if [ -f "$PLAYBOOK_PATH" ]
then
$ANSIBLE_PATH/ansible-playbook $PLAYBOOK_PATH
"$ANSIBLE_PATH/ansible-playbook $PLAYBOOK_PATH"
else
echo Ansible playbook not found at $PLAYBOOK_PATH
echo "Ansible playbook not found at $PLAYBOOK_PATH"
exit 1
fi

0 comments on commit aec82a0

Please sign in to comment.