summaryrefslogtreecommitdiff
path: root/utils/lib_sxng_themes.sh
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2025-01-15 17:26:45 +0100
committerMarkus Heiser <markus.heiser@darmarIT.de>2025-01-16 10:51:33 +0100
commit15d0e274b39340f19c3c5dde8cfdec451fa044c0 (patch)
treeff2235776b856d76249b6a3072633f78a1e071d4 /utils/lib_sxng_themes.sh
parente4f8f0483f418da953724ddcbc3d67cfe6373ea9 (diff)
[fix] build workflows of the themes
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'utils/lib_sxng_themes.sh')
-rwxr-xr-xutils/lib_sxng_themes.sh59
1 files changed, 41 insertions, 18 deletions
diff --git a/utils/lib_sxng_themes.sh b/utils/lib_sxng_themes.sh
index a276dd8c5..95d38ae8d 100755
--- a/utils/lib_sxng_themes.sh
+++ b/utils/lib_sxng_themes.sh
@@ -7,21 +7,41 @@ declare _creset
themes.help(){
cat <<EOF
themes.:
- all : build all themes
- live : to get live builds of CSS & JS use 'LIVE_THEME=simple make run'
- simple.: build simple theme
- test : test simple theme
+ all : test & build all themes
+ test : test all themes
+ fix : fix JS & CSS (LESS)
+ live : to get live builds of CSS & JS use: LIVE_THEME=simple make run
+ simple.: test & build simple theme ..
pygments: build pygment's LESS files for simple theme
+ test : test simple theme
+ fix : fix JS & CSS (LESS) of the simple theme
EOF
}
themes.all() {
( set -e
+ node.env
themes.simple
)
dump_return $?
}
+themes.fix() {
+ ( set -e
+ node.env
+ themes.simple.fix
+ )
+ dump_return $?
+}
+
+themes.test() {
+ ( set -e
+ node.env
+ themes.simple.test
+ )
+ dump_return $?
+}
+
themes.live() {
local LIVE_THEME="${LIVE_THEME:-${1}}"
case "${LIVE_THEME}" in
@@ -29,30 +49,30 @@ themes.live() {
theme="searx/static/themes/${LIVE_THEME}"
;;
'')
- die_caller 42 "missing theme argument"
+ die 42 "missing theme argument"
;;
*)
- die_caller 42 "unknown theme '${LIVE_THEME}' // [simple]'"
+ die 42 "unknown theme '${LIVE_THEME}' // [simple]'"
;;
esac
- build_msg GRUNT "theme: $1 (live build)"
- nodejs.ensure
+ build_msg SIMPLE "theme: $1 (live build)"
+ node.env
+ themes.simple.pygments
cd "${theme}"
{
- npm install
npm run watch
- } 2>&1 \
- | prefix_stdout "${_Blue}THEME ${1} ${_creset} " \
- | grep -E --ignore-case --color 'error[s]?[:]? |warning[s]?[:]? |'
+ } # 2>&1 \
+ # | prefix_stdout "${_Blue}THEME ${1} ${_creset} " \
+ # | grep -E --ignore-case --color 'error[s]?[:]? |warning[s]?[:]? |'
}
themes.simple() {
( set -e
- node.env
themes.simple.pygments
+ build_msg SIMPLE "theme: run build"
+ # "run build" includes tests from eslint and stylelint
+ npm --prefix searx/static/themes/simple run build
)
- build_msg GRUNT "theme: simple"
- npm --prefix searx/static/themes/simple run build
dump_return $?
}
@@ -67,11 +87,14 @@ themes.simple.pygments() {
return 0
}
+themes.simple.fix() {
+ build_msg SIMPLE "theme: fix"
+ npm --prefix searx/static/themes/simple run fix
+ dump_return $?
+}
themes.simple.test() {
- build_msg TEST "theme: simple"
- node.env
- npm --prefix searx/static/themes/simple install
+ build_msg SIMPLE "theme: run test"
npm --prefix searx/static/themes/simple run test
dump_return $?
}