on master help sign in
Merge pull request #1127 from kvch/remove-source-option-from-manage-sh
9fea206Adam Tauber
manage.sh+2−10
@@ -3,14 +3,6 @@
3BASE_DIR="$(dirname -- "`readlink -f -- "$0"`")"
3BASE_DIR="$(dirname -- "`readlink -f -- "$0"`")"
4export PATH="$BASE_DIR/node_modules/.bin":$PATH
4export PATH="$BASE_DIR/node_modules/.bin":$PATH
5
5
6−# the script can be sourced to update the PATH
7−# see https://stackoverflow.com/questions/2683279/how-to-detect-if-a-script-is-being-sourced
8−if [ $_ != $0 ]; then
9− unset BASE_DIR
10− # sourced : exit now
11− return
12−fi
13−
14# subshell
6# subshell
15PYTHONPATH="$BASE_DIR"
7PYTHONPATH="$BASE_DIR"
16SEARX_DIR="$BASE_DIR/searx"
8SEARX_DIR="$BASE_DIR/searx"
@@ -56,7 +48,7 @@ install_geckodriver() {
56
48
57 if [ -z "$1" ]; then
49 if [ -z "$1" ]; then
58 if [ -z "$VIRTUAL_ENV" ]; then
50 if [ -z "$VIRTUAL_ENV" ]; then
59− echo "geckodriver can't be installed because VIRTUAL_ENV is not set, you should download it from\n $GECKODRIVER_URL"
51+ printf "geckodriver can't be installed because VIRTUAL_ENV is not set, you should download it from\n %s" "$GECKODRIVER_URL"
60 exit
52 exit
61 else
53 else
62 GECKODRIVER_DIR="$VIRTUAL_ENV/bin"
54 GECKODRIVER_DIR="$VIRTUAL_ENV/bin"
@@ -66,7 +58,7 @@ install_geckodriver() {
66 mkdir -p -- "$GECKODRIVER_DIR"
58 mkdir -p -- "$GECKODRIVER_DIR"
67 fi
59 fi
68
60
69− echo "Installing $GECKODRIVER_DIR/geckodriver from\n $GECKODRIVER_URL"
61+ printf "Installing %s/geckodriver from\n %s" "$GECKODRIVER_DIR" "$GECKODRIVER_URL"
70
62
71 FILE="`mktemp`"
63 FILE="`mktemp`"
72 wget -qO "$FILE" -- "$GECKODRIVER_URL" && tar xz -C "$GECKODRIVER_DIR" -f "$FILE" geckodriver
64 wget -qO "$FILE" -- "$GECKODRIVER_URL" && tar xz -C "$GECKODRIVER_DIR" -f "$FILE" geckodriver