-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·49 lines (39 loc) · 1.06 KB
/
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
#!/usr/bin/env bash
set -e
declare repo_dir
repo_dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
# go to repo directory
cd "$repo_dir"
# args
declare machine="$1"
if [[ -z "$machine" ]]; then
echo 'missing required argument: <machine>' >&2
echo ' - laptop-william' >&2
echo ' - work-william' >&2
echo ' - server-data' >&2
exit 1
fi
# umask
echo '==> configure umask'
# TODO: need a plugin for this
# TODO: do I even need the umask in ~/.shared_profile with this set?
if type 'launchctl' >/dev/null 2>&1; then
sudo launchctl config user umask 002
sudo launchctl config system umask 002
fi
umask 002
# install nk
curl -fsSL 'https://raw.githubusercontent.com/ciiqr/nk/HEAD/install.sh' | bash
# add to path
export PATH="${HOME}/.nk/bin:${PATH}"
# setup git hooks
if [[ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" == "true" ]]; then
echo '==> setup git hooks'
git config --local core.hookspath .hooks
fi
# configure machine
echo '==> configure machine'
nk var set machine "$machine"
# provision
echo '==> provision'
nk provision