-
Notifications
You must be signed in to change notification settings - Fork 0
/
stowit.sh
executable file
·50 lines (37 loc) · 1.13 KB
/
stowit.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
#!/usr/bin/env bash
# Symlinking the dotfiles directory with stow(!)
# Running brew.sh to make sure stow gets installed
# Run this installation as root to symlink into root directory, type bash to use dotfiles or change default shell for root user (not recommended though)
# Uncomment if stow isn't installed yet
# ./brew.sh
# make sure we have pulled in and updated any submodules
git submodule init
git submodule update
# run stow command for passed in directory($2) in location($1)
base=(
bash
)
useronly=(
git # .extra not in the repository - contains gitconfig and commiter name
)
stowit() {
usr=$1
app=$2
stow -v -R -t ${usr} ${app}
}
echo ""
echo "Stowing apps for user: ${USER}"
# install apps available to local users and root
for app in ${base[@]}; do
stowit "${HOME}" $app
done
# install only user space folders
for app in ${useronly[@]}; do
if !(( "${USER}" = "root")); then
stowit "${HOME}" $app
fi
done
# Stow settings.json for vscode theme
stow -v -R -t "$HOME/Library/Application Support/Code/User" --dir=$HOME/code/dotfiles/vscode/ settings
echo ""
echo "Everything's stowed--"