diff options
| author | Markus Heiser <markus.heiser@darmarIT.de> | 2021-11-13 08:15:59 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-13 08:15:59 +0000 |
| commit | d64abb9310b2eaafffe42585f55d1a9d9457dd68 (patch) | |
| tree | 14f29979515e87931c334ce58b923072c8ed6e48 /manage | |
| parent | 0c70a96f57306c2dfa98adf9c6d4b958e1ad273a (diff) | |
| parent | 9bf53ab9740b8ba280b9145574795da6da6956ea (diff) | |
Merge pull request #473 from return42/searxng-wordmark
[simple theme] SearXNG wordmark & favicon
Diffstat (limited to 'manage')
| -rwxr-xr-x | manage | 38 |
1 files changed, 36 insertions, 2 deletions
@@ -692,11 +692,45 @@ themes.oscar() { } themes.simple() { - build_msg GRUNT "theme: simple" - npm --prefix searx/static/themes/simple run build + local src="searx/static/themes/simple/src" + local static="searx/static/themes/simple" + ( set -e + convert_if_newer "$src/svg/searxng-wordmark.svg" "$static/img/favicon.png" \ + -transparent white -resize 64x64 + build_msg GRUNT "theme: simple" + npm --prefix searx/static/themes/simple run build + ) dump_return $? } +convert_if_newer() { + + # usage: convert_if_newer <origfile> <outfile> [<options>, ...] + # + # convert_if_newer "path/to/origin.svg" "path/to/converted.png" -resize 100x100 + # + # Run's ImageMagik' convert comand to generate <outfile> from <origfile>, if + # <origfile> is newer than <outfile>. The command line is to convert is:: + # + # convert <origfile> [<options>, ...] <outfile> + + local src_file="$1" && shift + local dst_file="$1" && shift + + if [[ "${src_file}" -nt "${dst_file}" ]]; then + if ! required_commands convert; then + info_msg "to install build tools use::" + info_msg " sudo -H ./utils/searx.sh install buildhost" + die 1 "install needed build tools first" + fi + build_msg CONVERT "${src_file}" "$@" "${dst_file}" + convert "${src_file}" "$@" "${dst_file}" + else + build_msg CONVERT "${dst_file} (up-to-date)" + fi +} + + PYLINT_FILES=() while IFS= read -r line; do PYLINT_FILES+=("$line") |