mirror of
https://github.com/cytopia/devilbox.git
synced 2024-12-24 06:56:40 +00:00
Fix shellcheck for check-config
This commit is contained in:
parent
467fc03640
commit
3a2dacf748
@ -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}/.+/.+/" \
|
||||
|
Loading…
Reference in New Issue
Block a user