summaryrefslogtreecommitdiff
path: root/manage.sh
diff options
context:
space:
mode:
authordalf <alex@al-f.net>2018-08-26 10:32:32 +0200
committerdalf <alex@al-f.net>2018-08-26 10:32:32 +0200
commitd19a0f469c0ebcead08fd9e02dbf7b1e4e5e444c (patch)
treedc098137b41c915336cd4829d9d8ae9cc71e74a7 /manage.sh
parent052a71d05a159ccb08efb7c1bf0d42e75ecdd636 (diff)
downloadsearxng-d19a0f469c0ebcead08fd9e02dbf7b1e4e5e444c.tar.gz
searxng-d19a0f469c0ebcead08fd9e02dbf7b1e4e5e444c.zip
manage.sh : no error when npm is not found and not required
Diffstat (limited to 'manage.sh')
-rwxr-xr-xmanage.sh13
1 files changed, 11 insertions, 2 deletions
diff --git a/manage.sh b/manage.sh
index 3bc77fec3..a352ccc6e 100755
--- a/manage.sh
+++ b/manage.sh
@@ -5,8 +5,6 @@ BASE_DIR="$(dirname -- "`readlink -f -- "$0"`")"
cd -- "$BASE_DIR"
set -e
-export PATH="$(npm bin)":$PATH
-
# subshell
PYTHONPATH="$BASE_DIR"
SEARX_DIR="$BASE_DIR/searx"
@@ -111,7 +109,14 @@ tests() {
# Web
#
+npm_path_setup() {
+ which npm || (printf 'Error: npm is not found\n'; exit 1)
+ export PATH="$(npm bin)":$PATH
+}
+
npm_packages() {
+ npm_path_setup
+
echo '[!] install NPM packages'
cd -- "$BASE_DIR"
npm install less@2.7 less-plugin-clean-css grunt-cli
@@ -126,10 +131,14 @@ npm_packages() {
}
build_style() {
+ npm_path_setup
+
lessc --clean-css="--s1 --advanced --compatibility=ie9" "$BASE_DIR/searx/static/$1" "$BASE_DIR/searx/static/$2"
}
styles() {
+ npm_path_setup
+
echo '[!] Building legacy style'
build_style themes/legacy/less/style.less themes/legacy/css/style.css
build_style themes/legacy/less/style-rtl.less themes/legacy/css/style-rtl.css