-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·51 lines (46 loc) · 1.08 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
50
51
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
source "$SCRIPT_DIR/definitions"
if ! [ -d "$FASTDIRACT_DIR" ]; then
mkdir -p "$FASTDIRACT_DIR"
else
echo "error: $FASTDIRACT_DIR already exists"
fi
if ! [ -f "${FASTDIR_FILE}__default" ]; then
cat <<EOF > "${FASTDIR_FILE}__default"
d0 = ~/alpha
d1 = ~/beta
d2 = ~/gamma
d3 = ~/delta
d4 = ~/epsilon
d5 = ~/zeta
d6 = ~/eta
d7 = ~/theta
d8 = ~/iota
d9 = ~/kappa
EOF
ln -s "$FASTDIRACT_DIR/fastdirs__default" "$FASTDIR_FILE"
echo "Creating fastdirs template"
else
echo "fastdirs file already exists"
fi
if ! [ -f "${FASTACT_FILE}__default" ]; then
cat <<EOF > "${FASTACT_FILE}__default"
f0 = echo alpha
f1 = echo beta
f2 = echo gamma
f3 = echo delta
f4 = echo epsilon
f5 = echo zeta
f6 = echo eta
f7 = echo theta
f8 = echo iota
f9 = echo kappa
EOF
ln -s "$FASTDIRACT_DIR/fastactions__default" "$FASTACT_FILE"
echo "Creating fastactions template"
else
echo "fastactions file already exists"
fi
echo "Run \"source $SCRIPT_DIR/definitions\" and add it to your bashrc/zshrc file"