1
0
mirror of https://github.com/docker-mailserver/docker-mailserver.git synced 2025-08-08 23:06:49 +02:00

ci: fix ShellCheck linting for BATS tests (#3347)

* updated `lint.sh` to lint BATS (again)
* fix linting errors
This commit is contained in:
Georg Lauterbach
2023-05-23 16:33:58 +02:00
committed by GitHub
parent 1d2df8d499
commit abd72b6f10
11 changed files with 51 additions and 14 deletions

View File

@ -179,12 +179,12 @@ function _should_restart_when_killed() {
function _check_if_process_is_running() {
local PROCESS=${1}
local MIN_SECS_RUNNING
[[ -n ${2} ]] && MIN_SECS_RUNNING="--older ${2}"
[[ -n ${2:-} ]] && MIN_SECS_RUNNING=('--older' "${2}")
local IS_RUNNING=$(docker exec "${CONTAINER_NAME}" pgrep --list-full ${MIN_SECS_RUNNING} "${PROCESS}")
local IS_RUNNING=$(docker exec "${CONTAINER_NAME}" pgrep --list-full "${MIN_SECS_RUNNING[@]}" "${PROCESS}")
# When no matches are found, nothing is returned. Provide something we can assert on (helpful for debugging):
if [[ ! ${IS_RUNNING} =~ "${PROCESS}" ]]
if [[ ! ${IS_RUNNING} =~ ${PROCESS} ]]
then
echo "'${PROCESS}' is not running"
return 1