@@ -25,7 +25,7 @@ install_geckodriver() {
2525 return
2626 fi
2727 GECKODRIVER_VERSION="v0.18.0"
28− PLATFORM=`python -c "import platform; print platform.system().lower(), platform.architecture()[0]"`
28+ PLATFORM=`python -c "import six; import platform; six.print_(platform.system().lower(), platform.architecture()[0])"`
2929 case $PLATFORM in
3030 "linux 32bit" | "linux2 32bit") ARCH="linux32";;
3131 "linux 64bit" | "linux2 64bit") ARCH="linux64";;
@@ -34,16 +34,25 @@ install_geckodriver() {
3434 "mac 64bit") ARCH="macos";;
3535 esac
3636 GECKODRIVER_URL="https://github.com/mozilla/geckodriver/releases/download/$GECKODRIVER_VERSION/geckodriver-$GECKODRIVER_VERSION-$ARCH.tar.gz";
37− if [ -z "$VIRTUAL_ENV" ]; then
38− echo "geckodriver can't be installed because VIRTUAL_ENV is not set, you should download it from\n $GECKODRIVER_URL"
39− exit
37+
38+ if [ -z $1 ]; then
39+ if [ -z "$VIRTUAL_ENV" ]; then
40+ echo "geckodriver can't be installed because VIRTUAL_ENV is not set, you should download it from\n $GECKODRIVER_URL"
41+ exit
42+ else
43+ GECKODRIVER_DIR=$VIRTUAL_ENV/bin
44+ fi
4045 else
41− echo "Installing $VIRTUAL_ENV from\n $GECKODRIVER_URL"
42− FILE=`mktemp`
43− wget "$GECKODRIVER_URL" -qO $FILE && tar xz -C $VIRTUAL_ENV/bin/ -f $FILE geckodriver
44− rm $FILE
45− chmod 777 $VIRTUAL_ENV/bin/geckodriver
46+ GECKODRIVER_DIR=$1
47+ mkdir -p $GECKODRIVER_DIR
4648 fi
49+
50+ echo "Installing $GECKODRIVER_DIR from\n $GECKODRIVER_URL"
51+
52+ FILE=`mktemp`
53+ wget "$GECKODRIVER_URL" -qO $FILE && tar xz -C $GECKODRIVER_DIR -f $FILE geckodriver
54+ rm $FILE
55+ chmod 777 $GECKODRIVER_DIR/geckodriver
4756}
4857
4958pep8_check() {
@@ -91,18 +100,20 @@ styles() {
91100 build_style themes/courgette/less/style.less themes/courgette/css/style.css
92101 build_style themes/courgette/less/style-rtl.less themes/courgette/css/style-rtl.css
93102 build_style less/bootstrap/bootstrap.less css/bootstrap.min.css
94− build_style themes/oscar/less/pointhi/oscar.less themes/oscar/css/pointhi.min.css
95− build_style themes/oscar/less/logicodev/oscar.less themes/oscar/css/logicodev.min.css
96103 build_style themes/pix-art/less/style.less themes/pix-art/css/style.css
97− build_style themes/simple/less/style.less themes/simple/css/searx.min.css
98− build_style themes/simple/less/style-rtl.less themes/simple/css/searx-rtl.min.css
104+ # built using grunt
105+ #build_style themes/oscar/less/pointhi/oscar.less themes/oscar/css/pointhi.min.css
106+ #build_style themes/oscar/less/logicodev/oscar.less themes/oscar/css/logicodev.min.css
107+ #build_style themes/simple/less/style.less themes/simple/css/searx.min.css
108+ #build_style themes/simple/less/style-rtl.less themes/simple/css/searx-rtl.min.css
99109}
100110
101−grunt_packages() {
102− echo '[!] Grunt packages: install dependencies'
111+npm_packages() {
112+ echo '[!] install NPM packages for oscar theme'
103113 cd $BASE_DIR/searx/static/themes/oscar
104114 npm install
105−
115+
116+ echo '[!] install NPM packages for simple theme'
106117 cd $BASE_DIR/searx/static/themes/simple
107118 npm install
108119}
@@ -124,7 +135,7 @@ help() {
124135
125136Commands
126137========
127− grunt_packages - Download & install dependencies
138+ npm_packages - Download & install dependencies
128139 grunt_build - Build js files
129140 help - This text
130141 locales - Compile locales
@@ -142,4 +153,4 @@ Commands
142153
143154[ "$(command -V "$ACTION" | grep ' function$')" = "" ] \
144155 && help "action not found" \
145− || $ACTION
156+ || $ACTION $2