1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-17 09:50:13 +01:00

[fix] issues reported by shellcheck v0.9.0

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2024-01-07 18:37:11 +01:00 committed by Markus Heiser
parent f9c5727ddc
commit 54a6626582
2 changed files with 6 additions and 4 deletions

View File

@ -194,6 +194,7 @@ wait_key(){
[[ -n $FORCE_TIMEOUT ]] && _t=$FORCE_TIMEOUT [[ -n $FORCE_TIMEOUT ]] && _t=$FORCE_TIMEOUT
[[ -n $_t ]] && _t="-t $_t" [[ -n $_t ]] && _t="-t $_t"
printf "$msg" printf "$msg"
# shellcheck disable=SC2229
# shellcheck disable=SC2086 # shellcheck disable=SC2086
read -r -s -n1 $_t || true read -r -s -n1 $_t || true
echo echo
@ -227,7 +228,7 @@ ask_yn() {
while true; do while true; do
clean_stdin clean_stdin
printf "$1 ${choice} " printf "$1 ${choice} "
# shellcheck disable=SC2086 # shellcheck disable=SC2086,SC2229
read -r -n1 $_t read -r -n1 $_t
if [[ -z $REPLY ]]; then if [[ -z $REPLY ]]; then
printf "$default\n"; break printf "$default\n"; break
@ -261,7 +262,7 @@ tee_stderr () {
if [[ -n $1 ]] ; then _t="$1"; fi if [[ -n $1 ]] ; then _t="$1"; fi
(while read -r line; do (while read -r line; do
# shellcheck disable=SC2086 # shellcheck disable=SC2086,SC2229
sleep $_t sleep $_t
echo -e "$line" >&2 echo -e "$line" >&2
echo "$line" echo "$line"
@ -367,7 +368,7 @@ choose_one() {
printf "$1 [${_BGreen}$default${_creset}] " printf "$1 [${_BGreen}$default${_creset}] "
if (( 10 > max )); then if (( 10 > max )); then
# shellcheck disable=SC2086 # shellcheck disable=SC2086,SC2229
read -r -n1 $_t read -r -n1 $_t
else else
# shellcheck disable=SC2086,SC2229 # shellcheck disable=SC2086,SC2229
@ -708,6 +709,7 @@ pyenv.uninstall() {
pyenv.cmd python setup.py develop --uninstall 2>&1 \ pyenv.cmd python setup.py develop --uninstall 2>&1 \
| prefix_stdout "${_Blue}PYENV ${_creset}[pyenv.uninstall] " | prefix_stdout "${_Blue}PYENV ${_creset}[pyenv.uninstall] "
else else
# shellcheck disable=SC2086
pyenv.cmd python -m pip uninstall --yes ${PYOBJECTS} 2>&1 \ pyenv.cmd python -m pip uninstall --yes ${PYOBJECTS} 2>&1 \
| prefix_stdout "${_Blue}PYENV ${_creset}[pyenv.uninstall] " | prefix_stdout "${_Blue}PYENV ${_creset}[pyenv.uninstall] "
fi fi

View File

@ -37,7 +37,7 @@ is.static.build.commit() {
# check all files of the commit belongs to $STATIC_BUILT_PATHS # check all files of the commit belongs to $STATIC_BUILT_PATHS
commit_files=$(git diff-tree --no-commit-id --name-only -r "${commit_sha}") commit_files=$(git diff-tree --no-commit-id --name-only -r "${commit_sha}")
for i in ${STATIC_BUILT_PATHS[*]}; do for i in "${STATIC_BUILT_PATHS[@]}"; do
# remove files of ${STATIC_BUILT_PATHS} # remove files of ${STATIC_BUILT_PATHS}
commit_files=$(echo "${commit_files}" | grep -v "^${i}") commit_files=$(echo "${commit_files}" | grep -v "^${i}")
done done