refactor: combine bin directories

This commit is contained in:
Oliver Davies 2022-10-11 22:09:42 +01:00
parent f3f1051f1f
commit 459428a979
16 changed files with 0 additions and 38 deletions

View file

@ -1,38 +0,0 @@
#!/bin/bash
set -e
CONFIG_DIR="$HOME/.config/dotfiles"
DOTFILES_DIR="${DOTFILES_DIR:-$HOME/.dotfiles}"
PATH="${PATH}:${HOME}/.local/bin"
clone_or_update_dotfiles() {
if ! [[ -d "$DOTFILES_DIR" ]]; then
git clone "https://github.com/opdavies/dotfiles.git" "$DOTFILES_DIR"
else
git -C "$DOTFILES_DIR" pull
fi
}
create_config_dir() {
mkdir -p "${CONFIG_DIR}"
}
install_dependencies() {
ansible-galaxy install -r "${DOTFILES_DIR}/requirements.yml"
}
install_ansible() {
sudo apt-get -yqq update
sudo apt-get -yqq install python3-pip
pip install ansible --user
}
run_playbook() {
ansible-playbook --diff --extra-vars "@${CONFIG_DIR}/values.yaml" --vault-password-file=${CONFIG_DIR}/vault-password.txt "${DOTFILES_DIR}/main.yaml" "${@}"
}
clone_or_update_dotfiles
install_ansible
install_dependencies
run_playbook "${@}"