-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·50 lines (40 loc) · 926 Bytes
/
install.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
#!/bin/bash
set -eo pipefail
readonly COMMON_PACKAGES=(
bash
fish
git
mercurial
readline
screen
shell
tmux
neovim
ipython
)
readonly LINUX_PACKAGES=(
i3
x
)
readonly DOTFILES=$(dirname $0)
readonly STOW="stow --verbose=2 --dir=${DOTFILES} --target=${HOME}"
main() {
local additional_stow_args="$@"
local packages=(${COMMON_PACKAGES[*]})
if [[ "$(uname)" == "Linux" ]]; then
packages+=(${LINUX_PACKAGES[*]})
fi
# We don't want Stow's tree folding here - we prefer it to be a real
# directory.
mkdir -p "${HOME}/.config/fish"
$STOW $additional_stow_args ${packages[*]}
for package in ${packages[*]}; do
local install_script="${DOTFILES}/${package}/install.sh"
if [[ -x $install_script ]]; then
echo $install_script
/bin/sh $install_script
fi
done
echo "Done."
}
main $@