-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev_config.sh
executable file
·46 lines (38 loc) · 1.24 KB
/
dev_config.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
#!/bin/bash
bold=$(tput bold)
normal=$(tput sgr0)
WORKSPACE_FOLDER=~/workspace
py3=`python -c "import sys; print('1' if sys.version_info >= (3,0) else '0')"`
function link_folder {
FOLDER_PATH=$1
SYMLINK_NAME=$2
if [ ! -d ${FOLDER_PATH} ]; then
echo "WARNING: Target folder ${bold}${FOLDER_PATH}${normal} does not exist"
elif [ ! -d ${SYMLINK_NAME} ]; then
ln -sv ${FOLDER_PATH} ${SYMLINK_NAME}
else
echo "Folder ${bold}${SYMLINK_NAME}${normal} exists."
fi
}
function link_file {
TARGET_FILE=$1
SYMLINK_NAME=$2
if [ ! -f ${TARGET_FILE} ]; then
echo "WARNING: Target file ${bold}${TARGET_FILE}${normal} does not exist"
elif [ ! -f ${SYMLINK_NAME} ]; then
ln -sv ${TARGET_FILE} ${SYMLINK_NAME}
else
echo "File ${bold}${SYMLINK_NAME}${normal} exists."
fi
}
if [ ${py3} -eq 0 ]; then
echo "+-------------------------------+"
echo "| WARNING: Python 3 is required |"
echo "+-------------------------------+"
fi
# init submodules
git submodule init && git submodule update
# prerequisite packages
pip install -r requirements.txt -qq
link_folder `readlink -f ./modules/chirptext/chirptext` texttaglib/chirptext
link_folder `readlink -f ./modules/puchikarui/puchikarui` texttaglib/puchikarui