소스 검색

[fix] posix compatibility

Adam Tauber 9 년 전
부모
커밋
1d5afa4ccc
1개의 변경된 파일4개의 추가작업 그리고 6개의 파일을 삭제
  1. 4
    6
      manage.sh

+ 4
- 6
manage.sh 파일 보기

@@ -71,7 +71,7 @@ locales() {
71 71
 }
72 72
 
73 73
 help() {
74
-    [ -z "$1" ] || echo -e "Error: $1\n"
74
+    [ -z "$1" ] || printf "Error: $1\n"
75 75
     echo "Searx manage.sh help
76 76
 
77 77
 Commands
@@ -90,8 +90,6 @@ Commands
90 90
 "
91 91
 }
92 92
 
93
-if [ -n "$(type -t $ACTION)" ] && [ "$(type -t $ACTION)" = function ]; then
94
-    $ACTION
95
-else
96
-    help "action not found"
97
-fi
93
+[ "$(command -V "$ACTION" | grep ' function$')" != "" ] \
94
+    && $ACTION \
95
+    || help "action not found"