Browse Source

Merge pull request #1127 from kvch/remove-source-option-from-manage-sh

remove the option of sourcing manage.sh
Adam Tauber 6 years ago
parent
commit
9fea2060b5
No account linked to committer's email
1 changed files with 2 additions and 10 deletions
  1. 2
    10
      manage.sh

+ 2
- 10
manage.sh View File

@@ -3,14 +3,6 @@
3 3
 BASE_DIR="$(dirname -- "`readlink -f -- "$0"`")"
4 4
 export 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 6
 # subshell
15 7
 PYTHONPATH="$BASE_DIR"
16 8
 SEARX_DIR="$BASE_DIR/searx"
@@ -56,7 +48,7 @@ install_geckodriver() {
56 48
 
57 49
     if [ -z "$1" ]; then
58 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 52
             exit
61 53
         else
62 54
             GECKODRIVER_DIR="$VIRTUAL_ENV/bin"
@@ -66,7 +58,7 @@ install_geckodriver() {
66 58
         mkdir -p -- "$GECKODRIVER_DIR"
67 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 63
     FILE="`mktemp`"
72 64
     wget -qO "$FILE" -- "$GECKODRIVER_URL" && tar xz -C "$GECKODRIVER_DIR" -f "$FILE" geckodriver