Fix shellcheck for check-config

This commit is contained in:
cytopia 2020-11-20 13:37:09 +01:00
parent 467fc03640
commit 3a2dacf748
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2

View File

@ -94,6 +94,7 @@ file_get_perm() {
echo "${perm}"
}
# Get path with '~' replace with correct home path
get_path() {
echo "${1/#\~/${HOME}}"
}
@ -104,6 +105,7 @@ get_sub_dirs_level_1() {
local dir="${1}"
dir="${dir#./}" # Remove leading './' if it exists
dir="${dir%/}" # Remove trailing '/' if it exists
# shellcheck disable=SC2016
find "${dir}" \
| grep -Ev "^${dir}\$" \
| grep -Ev "^${dir}/.+/" \
@ -117,6 +119,7 @@ get_sub_dirs_level_2() {
local dir="${1}"
dir="${dir#./}" # Remove leading './' if it exists
dir="${dir%/}" # Remove trailing '/' if it exists
# shellcheck disable=SC2016
find "${dir}" \
| grep -Ev "^${dir}\$" \
| grep -Ev "^${dir}/.+/.+/" \