-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
48 lines (39 loc) · 815 Bytes
/
setup.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
#!/usr/bin/env bash
# make sure we have pulled in and updated any submodules
git submodule init
git submodule update
# what directories should be installable by all users including the root user
base=(
bash
)
# folders that should, or only need to be installed for a local user
useronly=(
git
zsh
completion
vim
termite
vscode
direnv
)
# run the stow command for the passed in directory ($2) in location $1
stowit() {
usr=$1
app=$2
# -v verbose
# -R recursive
# -t target
stow -v -R -t ${usr} ${app}
}
for app in ${base[@]}; do
stowit "${HOME}" $app
done
echo ""
echo "Stowing apps for user: ${whoami}"
for app in ${useronly[@]}; do
if [[ "$(whoami)" != "root" ]]; then
stowit "${HOME}" $app
fi
done
echo ""
echo "##### ALL DONE"