-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.stow
executable file
·81 lines (71 loc) · 1.28 KB
/
install.stow
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env bash
# make sure we have pulled in and updated any submodules
git submodule init
git submodule update
base=(
personal
nvim
git
tmux
php-cs-fixer
composer
kitty
)
mac=(
osx
fish
prettier
bash_osx
bin_osx
alacritty
karabiner
)
linux=(
zsh
bin_linux
prettier
)
my_profile() {
local unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) machine=linux;;
Darwin*) machine=macos;;
# CYGWIN*) machine=cygwin;;
# MINGW*) machine=min_gw;;
*) machine="UNKNOWN:${unameOut}"
esac
echo $machine
}
# 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 -R -t ${usr} ${app}
}
echo ""
echo "PROFILE: $(my_profile)"
echo "STOWING APPS FOR USER: ${whoami}"
# install apps available to local users and root
for app in ${base[@]}; do
echo "Stow: $app"
stowit "${HOME}" $app
done
if [[ $(my_profile) == "macos" ]]; then
echo ""
echo "PROFILE: macos"
for app in ${mac[@]}; do
echo "Stow: $app"
stowit "${HOME}" $app
done
fi
if [[ $(my_profile) == "linux" ]]; then
echo ""
echo "PROFILE: linux"
for app in ${linux[@]}; do
echo "Stow: $app"
stowit "${HOME}" $app
done
fi