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
 BASE_DIR="$(dirname -- "`readlink -f -- "$0"`")"
3
 BASE_DIR="$(dirname -- "`readlink -f -- "$0"`")"
4
 export PATH="$BASE_DIR/node_modules/.bin":$PATH
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
 # subshell
6
 # subshell
15
 PYTHONPATH="$BASE_DIR"
7
 PYTHONPATH="$BASE_DIR"
16
 SEARX_DIR="$BASE_DIR/searx"
8
 SEARX_DIR="$BASE_DIR/searx"
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
         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