-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·35 lines (28 loc) · 1.03 KB
/
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
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash
set -e
if [ `uname` == 'Linux' ]; then
if [ -f /etc/lsb-release -o -d /etc/lsb-release.d ]; then
OS=`lsb_release -i -s | tr '[:upper:]' '[:lower:]'`
else
OS=`ls -d /etc/[A-Za-z]*[_-][rv]e[lr]* | grep -v "lsb" | cut -d'/' -f3 | cut -d'-' -f1 | cut -d$'\n' -f1`
fi
else
OS=`uname | tr '[:upper:]' '[:lower:]'`
fi
CONFIG="install.conf.yaml"
DOTBOT_DIR="vendor/dotbot"
DOTBOT_BIN="bin/dotbot"
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# BOOTSTRAP_SCRIPT="${BASE_DIR}/os/${OS}.conf.yaml"
echo "Installing dotfiles for ${OS}"
cd "${BASE_DIR}"
git -C "${DOTBOT_DIR}" submodule sync --quiet --recursive
git submodule update --init --recursive "${DOTBOT_DIR}"
# if [[ -f "${BOOTSTRAP_SCRIPT}" ]]; then
# cmd=("${BASE_DIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASE_DIR}" -c "${BOOTSTRAP_SCRIPT}")
# "${cmd[@]}"
# else
# echo "Unsupported ${OS} or ${BOOTSTRAP_SCRIPT} not found."
# fi
echo "Running global configuration"
"${BASE_DIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASE_DIR}" -c "${CONFIG}" "${@}"