@@ -5,6 +5,8 @@ PYTHONPATH=$BASE_DIR
55SEARX_DIR="$BASE_DIR/searx"
66ACTION=$1
77
8+cd $BASE_DIR
9+
810update_packages() {
911 pip install -r "$BASE_DIR/requirements.txt"
1012}
@@ -14,7 +16,7 @@ update_dev_packages() {
1416 pip install -r "$BASE_DIR/requirements-dev.txt"
1517}
1618
17−check_geckodriver() {
19+install_geckodriver() {
1820 echo '[!] Checking geckodriver'
1921 set -e
2022 geckodriver -V 2>1 > /dev/null || NOTFOUND=1
@@ -73,37 +75,47 @@ tests() {
7375 set -e
7476 pep8_check
7577 unit_tests
76− check_geckodriver
78+ install_geckodriver
7779 robot_tests
7880 set +e
7981}
8082
8183build_style() {
82− # lessc -x "$BASE_DIR/searx/static/$1" "$BASE_DIR/searx/static/$2"
8384 lessc --clean-css="--s1 --advanced --compatibility=ie9" "$BASE_DIR/searx/static/$1" "$BASE_DIR/searx/static/$2"
8485}
8586
8687styles() {
8788 echo '[!] Building styles'
88− build_style themes/legacy/less/style.less themes/legacy/css/style.css
89− build_style themes/legacy/less/style-rtl.less themes/legacy/css/style-rtl.css
90− build_style themes/courgette/less/style.less themes/courgette/css/style.css
91− build_style themes/courgette/less/style-rtl.less themes/courgette/css/style-rtl.css
92− build_style less/bootstrap/bootstrap.less css/bootstrap.min.css
93− build_style themes/oscar/less/pointhi/oscar.less themes/oscar/css/pointhi.min.css
94− build_style themes/oscar/less/logicodev/oscar.less themes/oscar/css/logicodev.min.css
95− build_style themes/pix-art/less/style.less themes/pix-art/css/style.css
96− build_style themes/simple/less/style.less themes/simple/css/searx.min.css
97− build_style themes/simple/less/style-rtl.less themes/simple/css/searx-rtl.min.css
89+ build_style themes/legacy/less/style.less themes/legacy/css/style.css
90+ build_style themes/legacy/less/style-rtl.less themes/legacy/css/style-rtl.css
91+ build_style themes/courgette/less/style.less themes/courgette/css/style.css
92+ build_style themes/courgette/less/style-rtl.less themes/courgette/css/style-rtl.css
93+ 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
96+ 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
99+}
100+
101+grunt_packages() {
102+ echo '[!] Grunt packages: install dependencies'
103+ cd $BASE_DIR/searx/static/themes/oscar
104+ npm install
105+
106+ cd $BASE_DIR/searx/static/themes/simple
107+ npm install
98108}
99109
100110grunt_build() {
101− grunt --gruntfile "$SEARX_DIR/static/themes/oscar/gruntfile.js"
102− grunt --gruntfile "$SEARX_DIR/static/themes/simple/gruntfile.js"
111+ echo '[!] Grunt build : oscar theme'
112+ grunt --gruntfile "$SEARX_DIR/static/themes/oscar/gruntfile.js"
113+ echo '[!] Grunt build : simple theme'
114+ grunt --gruntfile "$SEARX_DIR/static/themes/simple/gruntfile.js"
103115}
104116
105117locales() {
106− pybabel compile -d "$SEARX_DIR/translations"
118+ pybabel compile -d "$SEARX_DIR/translations"
107119}
108120
109121help() {
@@ -112,6 +124,7 @@ help() {
112124
113125Commands
114126========
127+ grunt_packages - Download & install dependencies
115128 grunt_build - Build js files
116129 help - This text
117130 locales - Compile locales
@@ -123,7 +136,7 @@ Commands
123136 unit_tests - Run unit tests
124137 update_dev_packages - Check & update development and production dependency changes
125138 update_packages - Check & update dependency changes
126− check_geckodriver - Check & download geckodriver (required for robot_tests)
139+ install_geckodriver - Download & install geckodriver if not already installed (required for robot_tests)
127140"
128141}
129142