refactor: combine bin directories
This commit is contained in:
parent
f3f1051f1f
commit
459428a979
38
bin/dotfiles
38
bin/dotfiles
|
@ -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 "${@}"
|
|
Loading…
Reference in a new issue