summaryrefslogtreecommitdiff
path: root/manage
diff options
context:
space:
mode:
Diffstat (limited to 'manage')
-rwxr-xr-xmanage50
1 files changed, 44 insertions, 6 deletions
diff --git a/manage b/manage
index 4323c9424..1643802f4 100755
--- a/manage
+++ b/manage
@@ -124,6 +124,21 @@ fi
# needed by sphinx-docs
export DOCS_BUILD
+webapp.run() {
+ local parent_proc="$$"
+ (
+ if [ "${LIVE_THEME}" ]; then
+ ( themes.live "${LIVE_THEME}" )
+ kill $parent_proc
+ fi
+ )&
+ (
+ sleep 3
+ xdg-open http://127.0.0.1:8888/
+ )&
+ SEARXNG_DEBUG=1 pyenv.cmd python -m searx.webapp
+}
+
buildenv() {
# settings file from repository's working tree are used by default
@@ -518,12 +533,15 @@ gecko.driver() {
dump_return $?
}
-node.env() {
+nodejs.ensure() {
if ! nvm.min_node "${NODE_MINIMUM_VERSION}"; then
info_msg "install Node.js by NVM"
nvm.nodejs
fi
+}
+node.env() {
+ nodejs.ensure
( set -e
build_msg INSTALL "searx/static/themes/oscar/package.json"
@@ -705,6 +723,30 @@ themes.all() {
dump_return $?
}
+themes.live() {
+ local LIVE_THEME="${LIVE_THEME:-${1}}"
+ case "${LIVE_THEME}" in
+ simple|oscar)
+ theme="searx/static/themes/${LIVE_THEME}"
+ ;;
+ '')
+ die_caller 42 "missing theme argument"
+ ;;
+ *)
+ die_caller 42 "unknown theme '${LIVE_THEME}' // [simple|oscar]'"
+ ;;
+ esac
+ build_msg GRUNT "theme: $1 (live build)"
+ nodejs.ensure
+ cd "${theme}"
+ {
+ npm install
+ npm run watch
+ } 2>&1 \
+ | prefix_stdout "${_Blue}THEME ${1} ${_creset} " \
+ | grep -E --ignore-case --color 'error[s]?[:]? |warning[s]?[:]? |'
+}
+
themes.oscar() {
build_msg GRUNT "theme: oscar"
npm --prefix searx/static/themes/oscar run build
@@ -712,7 +754,6 @@ themes.oscar() {
}
themes.simple() {
- local static="searx/static/themes/simple"
( set -e
build_msg GRUNT "theme: simple"
npm --prefix searx/static/themes/simple run build
@@ -722,10 +763,7 @@ themes.simple() {
themes.simple.test() {
build_msg TEST "theme: simple"
- if ! nvm.min_node "${NODE_MINIMUM_VERSION}"; then
- info_msg "install Node.js by NVM"
- nvm.nodejs
- fi
+ nodejs.ensure
npm --prefix searx/static/themes/simple install
npm --prefix searx/static/themes/simple run test
dump_return $?