diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2021-12-01 20:25:39 +0100 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2021-12-01 20:25:39 +0100 |
commit | c89d2aab3fe4b13dbab98e9b03d3d10de16fac3e (patch) | |
tree | 08d6cfb29d497c13f4a519a36eebecc3b3a310f0 /utils | |
parent | e62733fcf3bbc1af099e81555c42819624fffc2a (diff) | |
download | searxng-c89d2aab3fe4b13dbab98e9b03d3d10de16fac3e.tar.gz searxng-c89d2aab3fe4b13dbab98e9b03d3d10de16fac3e.zip |
[mod] make static.build.commit more robust
- use single quote in the STATIC_BUILT_PATHS to avoid bash globbing
- don't try to commit if no files have been changed
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/lib_static.sh | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/utils/lib_static.sh b/utils/lib_static.sh index 785bb2687..2a5efeda0 100755 --- a/utils/lib_static.sh +++ b/utils/lib_static.sh @@ -4,16 +4,16 @@ 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 + '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(){ @@ -112,6 +112,12 @@ static.build.commit() { git add -v "${built_path}" done + # check if any file has been added (in case of no changes) + if [ -z "$(git diff --name-only --cached)" ]; then + build_msg STATIC "no changes applied / nothing to commit" + return 0 + fi + # 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" |