forked from WolfgangFahl/ProceedingsTitleParser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·70 lines (67 loc) · 1.57 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
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
#!/bin/bash
# WF 2020-03-25
os=$(uname -a)
useroption="--user"
#
# autoinstall the package for the given command
#
autoinstall() {
local l_cmd="$1"
local l_package="$2"
echo "checking whether $l_cmd is installed ..."
which $l_cmd
if [ $? -ne 0 ]
then
echo "installing $l_cmd from package $l_package ..."
$install $l_package
fi
}
case $os in
Darwin*)
pip="pip3"
install="sudo port install"
;;
*)
pip="pip3"
if [ "$USER" = "travis" ]
then
# https://stackoverflow.com/a/20621143/1497139
echo "environment is travis with python version $TRAVIS_PYTHON_VERSION"
pip="pip"
useroption=""
fi
install="sudo apt-get install"
;;
esac
#$install python3-pip
autoinstall jq jq
$pip --version
echo "installing required python modules with useroption $useroption"
$pip install $useroption -r requirements.txt
wd=$(pwd)
if [ ! -d web ]
then
echo "installing needed web files from diagrams.bitplan.com project"
tmp=/tmp
cd $tmp
git clone https://github.com/BITPlan/diagrams
mv $tmp/diagrams/web $wd/web
rm -rf /tmp/diagrams
cd $wd
else
echo "need web files already installed"
fi
# make sure pywikibot configuration is available
if [ ! -d $HOME/.pywikibot ]
then
mkdir $HOME/.pywikibot
echo "creating user-config.py"
echo "put_throttle = 0" > $HOME/.pywikibot/user-config.py
fi
# make sure there is cache directory
mkdir -p cache
# download spacy NLP
# https://github.com/explosion/spacy-models/releases//tag/en_core_web_sm-2.3.1
python3 -m spacy download en_core_web_sm
# used fixed geography-nltk script
scripts/geograpy-nltk