#!/usr/bin/env bash # SPDX-License-Identifier: AGPL-3.0-or-later STATIC_BUILD_COMMIT="[build] /static" STATIC_BUILT_PATHS=( searx/static/themes/oscar/css searx/static/themes/oscar/js searx/static/themes/oscar/src/generated/pygments-logicodev.less searx/static/themes/oscar/src/generated/pygments-pointhi.less searx/static/themes/simple/css searx/static/themes/simple/js searx/static/themes/simple/src/generated/pygments.less searx/static/themes/simple/img searx/templates/__common__/searxng-wordmark.min.svg searx/templates/simple/icons.html ) static_help(){ cat </dev/null ( set -e # build the themes themes.all # add build files for built_path in "${STATIC_BUILT_PATHS[@]}"; do git add -v "${built_path}" done # check for modified files that are not staged if [ -n "$(git diff --name-only)" ]; then die 42 "themes.all has created files that are not in STATIC_BUILT_PATHS" fi git commit -m "${STATIC_BUILD_COMMIT}" ) } static.build.restore() { build_msg STATIC "git-restore of the built files (/static)" git restore --staged "${STATIC_BUILT_PATHS[@]}" git restore --worktree "${STATIC_BUILT_PATHS[@]}" }