-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.sh
executable file
·64 lines (52 loc) · 1.38 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env bash
set -euo pipefail
ROOT=$(pwd)
find $ROOT/bin/ -type f -iname "*.sh" -exec chmod +x {} \;
source $ROOT/scripts/helpers.sh
load_shell() {
action "load shell"
source $HOME/.zshrc
}
link_dotfiles() {
shopt -s dotglob
for f in $ROOT/dots/*; do
filename="${f##*/}"
if [ -d "$f" ]; then
echo "$f"\n
else
ln -s -f $f $HOME/$filename
ok "symlink created for $HOME/$filename"
fi
done
if [ -d $HOME/.config ]; then
fancy_echo ".config already present...deleting"
else
for f in $ROOT/config/*; do
if [ "$f" == "vscode/"]; then
fancy_echo "$f"
fi
done
action "setup XDG_CONFIG_HOME"
# ln -s $ROOT/config $HOME/.config
fi
}
prereq() {
if ! command -v brew >/dev/null; then
fancy_echo "Installing Homebrew ..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
else
fancy_echo "Homebrew already installed..."
fi
if ! command -v ansible-playbook >/dev/null; then
fancy_echo "Installing ansible..."
brew install ansible
else
fancy_echo "ansible already installed..."
fi
}
bootstrap() {
envsubst | ansible-playbook -i hosts \
--extra-vars='@config.yaml' \
main.yaml
}
"${@:-help}"