-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·24 lines (17 loc) · 886 Bytes
/
install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env sh
# http://stackoverflow.com/a/29835459/1024122
readonly _basedir=$(CDPATH='' cd -- "$(dirname -- "${0}")" && pwd -P)
readonly _dotbot_dir='3dparty/dotbot'
readonly _dotbot_bin="${_dotbot_dir}/bin/dotbot"
readonly _config='install.yaml'
[ -d "${_basedir}" ] && [ -x "${_basedir}" ] \
|| { echo "Failed to get base directory" >&2; exit 1; }
cd -- "${_basedir}" >/dev/null || exit 1
[ -d "${_dotbot_dir}" ] && [ -x "${_dotbot_dir}" ] \
|| { echo "Cannot find dotbot directory [${_dotbot_dir}]" >&2; exit 1; }
[ -f "${_config}" ] \
|| { echo "Cannot find dotbot config [${_config}]" >&2; exit 1; }
git submodule --quiet update --init --recursive
[ -f "${_dotbot_bin}" ] && [ -x "${_dotbot_bin}" ] \
|| { echo "Dotbot binary [${_dotbot_bin}] does not exist or is not executable" >&2; exit 1; }
exec "${_dotbot_bin}" -d "${_basedir}" -c "${_config}" -v "${@}"