|
@@ -5,6 +5,8 @@ PYTHONPATH=$BASE_DIR
|
|
|
SEARX_DIR="$BASE_DIR/searx"
|
|
|
ACTION=$1
|
|
|
|
|
|
+cd $BASE_DIR
|
|
|
+
|
|
|
update_packages() {
|
|
|
pip install -r "$BASE_DIR/requirements.txt"
|
|
|
}
|
|
@@ -14,7 +16,7 @@ update_dev_packages() {
|
|
|
pip install -r "$BASE_DIR/requirements-dev.txt"
|
|
|
}
|
|
|
|
|
|
-check_geckodriver() {
|
|
|
+install_geckodriver() {
|
|
|
echo '[!] Checking geckodriver'
|
|
|
set -e
|
|
|
geckodriver -V 2>1 > /dev/null || NOTFOUND=1
|
|
@@ -73,37 +75,47 @@ tests() {
|
|
|
set -e
|
|
|
pep8_check
|
|
|
unit_tests
|
|
|
- check_geckodriver
|
|
|
+ install_geckodriver
|
|
|
robot_tests
|
|
|
set +e
|
|
|
}
|
|
|
|
|
|
build_style() {
|
|
|
- # lessc -x "$BASE_DIR/searx/static/$1" "$BASE_DIR/searx/static/$2"
|
|
|
lessc --clean-css="--s1 --advanced --compatibility=ie9" "$BASE_DIR/searx/static/$1" "$BASE_DIR/searx/static/$2"
|
|
|
}
|
|
|
|
|
|
styles() {
|
|
|
echo '[!] Building styles'
|
|
|
- build_style themes/legacy/less/style.less themes/legacy/css/style.css
|
|
|
- build_style themes/legacy/less/style-rtl.less themes/legacy/css/style-rtl.css
|
|
|
- build_style themes/courgette/less/style.less themes/courgette/css/style.css
|
|
|
- build_style themes/courgette/less/style-rtl.less themes/courgette/css/style-rtl.css
|
|
|
- build_style less/bootstrap/bootstrap.less css/bootstrap.min.css
|
|
|
- build_style themes/oscar/less/pointhi/oscar.less themes/oscar/css/pointhi.min.css
|
|
|
- build_style themes/oscar/less/logicodev/oscar.less themes/oscar/css/logicodev.min.css
|
|
|
- build_style themes/pix-art/less/style.less themes/pix-art/css/style.css
|
|
|
- build_style themes/simple/less/style.less themes/simple/css/searx.min.css
|
|
|
- build_style themes/simple/less/style-rtl.less themes/simple/css/searx-rtl.min.css
|
|
|
+ build_style themes/legacy/less/style.less themes/legacy/css/style.css
|
|
|
+ build_style themes/legacy/less/style-rtl.less themes/legacy/css/style-rtl.css
|
|
|
+ build_style themes/courgette/less/style.less themes/courgette/css/style.css
|
|
|
+ build_style themes/courgette/less/style-rtl.less themes/courgette/css/style-rtl.css
|
|
|
+ build_style less/bootstrap/bootstrap.less css/bootstrap.min.css
|
|
|
+ build_style themes/oscar/less/pointhi/oscar.less themes/oscar/css/pointhi.min.css
|
|
|
+ build_style themes/oscar/less/logicodev/oscar.less themes/oscar/css/logicodev.min.css
|
|
|
+ build_style themes/pix-art/less/style.less themes/pix-art/css/style.css
|
|
|
+ build_style themes/simple/less/style.less themes/simple/css/searx.min.css
|
|
|
+ build_style themes/simple/less/style-rtl.less themes/simple/css/searx-rtl.min.css
|
|
|
+}
|
|
|
+
|
|
|
+grunt_packages() {
|
|
|
+ echo '[!] Grunt packages: install dependencies'
|
|
|
+ cd $BASE_DIR/searx/static/themes/oscar
|
|
|
+ npm install
|
|
|
+
|
|
|
+ cd $BASE_DIR/searx/static/themes/simple
|
|
|
+ npm install
|
|
|
}
|
|
|
|
|
|
grunt_build() {
|
|
|
- grunt --gruntfile "$SEARX_DIR/static/themes/oscar/gruntfile.js"
|
|
|
- grunt --gruntfile "$SEARX_DIR/static/themes/simple/gruntfile.js"
|
|
|
+ echo '[!] Grunt build : oscar theme'
|
|
|
+ grunt --gruntfile "$SEARX_DIR/static/themes/oscar/gruntfile.js"
|
|
|
+ echo '[!] Grunt build : simple theme'
|
|
|
+ grunt --gruntfile "$SEARX_DIR/static/themes/simple/gruntfile.js"
|
|
|
}
|
|
|
|
|
|
locales() {
|
|
|
- pybabel compile -d "$SEARX_DIR/translations"
|
|
|
+ pybabel compile -d "$SEARX_DIR/translations"
|
|
|
}
|
|
|
|
|
|
help() {
|
|
@@ -112,6 +124,7 @@ help() {
|
|
|
|
|
|
Commands
|
|
|
========
|
|
|
+ grunt_packages - Download & install dependencies
|
|
|
grunt_build - Build js files
|
|
|
help - This text
|
|
|
locales - Compile locales
|
|
@@ -123,7 +136,7 @@ Commands
|
|
|
unit_tests - Run unit tests
|
|
|
update_dev_packages - Check & update development and production dependency changes
|
|
|
update_packages - Check & update dependency changes
|
|
|
- check_geckodriver - Check & download geckodriver (required for robot_tests)
|
|
|
+ install_geckodriver - Download & install geckodriver if not already installed (required for robot_tests)
|
|
|
"
|
|
|
}
|
|
|
|