3BASE_DIR="$(dirname -- "`readlink -f -- "$0"`")"
5SEARX_DIR="$BASE_DIR/searx"
11 pip install --upgrade pip
12 pip install --upgrade setuptools
13 pip install -r "$BASE_DIR/requirements.txt"
16update_dev_packages() {
18 pip install -r "$BASE_DIR/requirements-dev.txt"
21install_geckodriver() {
22 echo '[!] Checking geckodriver'
23 # TODO : check the current geckodriver version
25 geckodriver -V > /dev/null 2>&1 || NOTFOUND=1
27 if [ -z "$NOTFOUND" ]; then
30 GECKODRIVER_VERSION="v0.18.0"
31 PLATFORM="`python -c "import six; import platform; six.print_(platform.system().lower(), platform.architecture()[0])"`"
33 "linux 32bit" | "linux2 32bit") ARCH="linux32";;
34 "linux 64bit" | "linux2 64bit") ARCH="linux64";;
35 "windows 32 bit") ARCH="win32";;
36 "windows 64 bit") ARCH="win64";;
37 "mac 64bit") ARCH="macos";;
39 GECKODRIVER_URL="https://github.com/mozilla/geckodriver/releases/download/$GECKODRIVER_VERSION/geckodriver-$GECKODRIVER_VERSION-$ARCH.tar.gz";
42 if [ -z "$VIRTUAL_ENV" ]; then
43 echo "geckodriver can't be installed because VIRTUAL_ENV is not set, you should download it from\n $GECKODRIVER_URL"
46 GECKODRIVER_DIR="$VIRTUAL_ENV/bin"
50 mkdir -p -- "$GECKODRIVER_DIR"
53 echo "Installing $GECKODRIVER_DIR/geckodriver from\n $GECKODRIVER_URL"
56 wget -qO "$FILE" -- "$GECKODRIVER_URL" && tar xz -C "$GECKODRIVER_DIR" -f "$FILE" geckodriver
58 chmod 777 -- "$GECKODRIVER_DIR/geckodriver"
62 echo '[!] Running pep8 check'
64 # E402 module level import not at top of file
65 # W503 line break before binary operator
66 pep8 --exclude=searx/static --max-line-length=120 --ignore "E402,W503" "$SEARX_DIR" "$BASE_DIR/tests"
70 echo '[!] Running unit tests'
71 python -m nose2 -s "$BASE_DIR/tests/unit"
75 echo '[!] Running python test coverage'
76 PYTHONPATH="`pwd`" python -m nose2 -C --log-capture --with-coverage --coverage "$SEARX_DIR" -s "$BASE_DIR/tests/unit" \
82 echo '[!] Running robot tests'
83 PYTHONPATH="`pwd`" python "$SEARX_DIR/testing.py" robot
96 lessc --clean-css="--s1 --advanced --compatibility=ie9" "$BASE_DIR/searx/static/$1" "$BASE_DIR/searx/static/$2"
100 echo '[!] Building styles'
101 build_style themes/legacy/less/style.less themes/legacy/css/style.css
102 build_style themes/legacy/less/style-rtl.less themes/legacy/css/style-rtl.css
103 build_style themes/courgette/less/style.less themes/courgette/css/style.css
104 build_style themes/courgette/less/style-rtl.less themes/courgette/css/style-rtl.css
105 build_style less/bootstrap/bootstrap.less css/bootstrap.min.css
106 build_style themes/pix-art/less/style.less themes/pix-art/css/style.css
108 #build_style themes/oscar/less/pointhi/oscar.less themes/oscar/css/pointhi.min.css
109 #build_style themes/oscar/less/logicodev/oscar.less themes/oscar/css/logicodev.min.css
110 #build_style themes/simple/less/style.less themes/simple/css/searx.min.css
111 #build_style themes/simple/less/style-rtl.less themes/simple/css/searx-rtl.min.css
115 echo '[!] install NPM packages for oscar theme'
116 cd -- "$BASE_DIR/searx/static/themes/oscar"
119 echo '[!] install NPM packages for simple theme'
120 cd -- "$BASE_DIR/searx/static/themes/simple"
125 echo '[!] Grunt build : oscar theme'
126 grunt --gruntfile "$SEARX_DIR/static/themes/oscar/gruntfile.js"
127 echo '[!] Grunt build : simple theme'
128 grunt --gruntfile "$SEARX_DIR/static/themes/simple/gruntfile.js"
132 pybabel compile -d "$SEARX_DIR/translations"
136 [ -z "$1" ] || printf 'Error: %s\n' "$1"
137 echo "Searx manage.sh help
141 npm_packages - Download & install dependencies
142 grunt_build - Build js files
144 locales - Compile locales
145 pep8_check - Pep8 validation
146 py_test_coverage - Unit test coverage
147 robot_tests - Run selenium tests
148 styles - Build less files
149 tests - Run all python tests (pep8, unit, robot)
150 unit_tests - Run unit tests
151 update_dev_packages - Check & update development and production dependency changes
152 update_packages - Check & update dependency changes
153 install_geckodriver - Download & install geckodriver if not already installed (required for robot_tests)
157[ "$(command -V "$ACTION" | grep ' function$')" = "" ] \
158 && help "action not found" \
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list