aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/install.sh
blob: 4d029c4dcf9fa2e0dcd4f4a4ec0619d0a5eb4aef (plain)
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 bash

set -e

# Default settings
SETTING_DIR=${SETTING_DIR:-~/settings}
REPO=${REPO:-typebrook/settings}
REMOTE=${REMOTE:-https://github.com/${REPO}.git}
BRANCH=${BRANCH:-master}

git clone --depth=1 --branch "$BRANCH" "$REMOTE" "$SETTING_DIR" || {
	error "git clone of settings repo failed"
	exit 1
}

sed "/^# $REPO/, /^$/ d"
cat <<EOF
# $REPO
export SETTING_DIR=$HOME/settings
source $SETTING_DIR/tools/load-settings.sh

EOF

cd "$SETTING_DIR" && make