This repository was archived by the owner on Jun 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevsetup.sh
More file actions
executable file
·108 lines (71 loc) · 2.09 KB
/
devsetup.sh
File metadata and controls
executable file
·108 lines (71 loc) · 2.09 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/usr/bin/env bash
. ./scripts/config.sh
[ "$DEBUG" ] && set -x
set -e
MESSAGES=()
main() {
printf 'Checking for requirements... '
for req in "${INIT_REQUIRE[@]}"; do
use "$req"
done
echo 'done'
# ---
printf 'Setting up symlinks... '
mkdir -p -- "$BINDIR"
while read -r file; do
[ -x "$file" ] || continue
sl="$BINDIR$(basename -- "$file")"
[ -h "$sl" ] && unlink "$sl"
ln -s "$(pwd)/$file" "$sl"
done <<<"$(find "${SYM_DIRS[@]}" -type f)"
MESSAGES+=("Make sure $BINDIR is in your PATH (add this to your bashrc or whatever): export PATH=\"\$PATH:$BINDIR\"")
echo 'done'
# ---
printf 'Setting up bash completion... '
mkdir -p -- "$COMPDIR"
sl="$COMPDIR/rysc"
[ -h "$sl" ] && unlink "$sl"
ln -s "$(pwd)/completions/rysc.bash" "$sl"
echo 'done'
# ---
if command -v vim >/dev/null; then
printf 'Setting up vim... '
# Syntax file
mkdir -p -- "$VIMDIR/syntax"
sl="$VIMDIR/syntax/rys.vim"
[ -h "$sl" ] && unlink "$sl"
ln -s "$(pwd)/editor/rys.vim" "$sl"
# File detection
mkdir -p -- "$VIMDIR/ftdetect"
sl="$VIMDIR/ftdetect/rys.vim"
[ -h "$sl" ] && unlink "$sl"
ln -s "$(pwd)/editor/rys.ftp.vim" "$sl"
echo 'done'
MESSAGES+=("You might need to add this to vimrc if syntax does not work: autocmd BufRead,BufNewFile *.rys set filetype=rys")
fi
# ---
if command -v pip >/dev/null; then
printf 'Installing python requirements... '
pip install --quiet --user -r requirements.txt
echo 'done'
else
MESSAGES+=("Please install all python requirements from requirements.txt file")
fi
# ---
echo 'Setup finished!'
# ---
if [ "${MESSAGES[0]}" ]; then
echo
echo ' ** Messages:'
for message in "${MESSAGES[@]}"; do
echo " * $message"
done
fi
# ---
echo
echo ' ** Extra packages:'
for package in "${DEV_PKGS[@]}"; do
echo " * $package"
done
}
main "$@"