-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·49 lines (41 loc) · 913 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
48
#!/usr/bin/env bash
set -eu
#set -x # debug
dotfiles_root=$(pwd)
# @param array list
# The `list` variable containes list of src file/directory
# which will be linked to actual config one. The path is relative
# path from project root.
: "pre-process" && {
cd $(dirname $0)
list=$(cat list)
PATH="$(pwd)/script:$PATH"
}
: "main" && {
cd $HOME
for file in ${list[*]}
do
src="$dotfiles_root/$file"
dist="$HOME/$file"
make_parent_directory "$dist"
make_symbolic_link "$src" "$dist"
done
}
: "brew" && {
cd $dotfiles_root
if type brew &>/dev/null ; then
brew bundle
brew cleanup
brew autoremove
else
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
}
: "volta" && {
if type volta &>/dev/null ; then
volta install node
volta install yarn
else
curl https://get.volta.sh | bash
fi
}