From 8234844e3d00adc930aced0cf2e4ebf7ce18873e Mon Sep 17 00:00:00 2001 From: Mykyta Solomko Date: Thu, 29 Apr 2021 22:48:10 +0300 Subject: [PATCH] Added _DIRS_UNSORTED --- scripts/lib/lint-common.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/lib/lint-common.sh b/scripts/lib/lint-common.sh index 229f900..c5c3bd4 100644 --- a/scripts/lib/lint-common.sh +++ b/scripts/lib/lint-common.sh @@ -56,12 +56,14 @@ RET=0 EXTRA_ARGS='' _SEARCH_DIRS=${_SEARCH_DIRS:-/tmp/lint-dirs.txt} +_DIRS_UNSORTED=${_DIRS_UNSORTED:-/tmp/lint-dirs-unsorted.txt} _CHECK_FILES=${_CHECK_FILES:-/tmp/lint-files.txt} _FILES_UNSORTED=${_FILES_UNSORTED:-/tmp/lint-files-unsorted.txt} _BEFORE_SCRIPT=${_BEFORE_SCRIPT:-/tmp/lint-before.sh} touch "${_SEARCH_DIRS}" \ "${_CHECK_FILES}" \ + "${_DIRS_UNSORTED}" \ "${_FILES_UNSORTED}" before_script() @@ -88,7 +90,7 @@ _dir_list() # for _d in ${PLUGIN_PATH[*]}; do if [[ -d ${_d} ]]; then - readlink -f "${_d}" >> "${_SEARCH_DIRS}" + readlink -f "${_d}" >> "${_DIRS_UNSORTED}" else echo "Path ${_d} does not exist!" 1>&2 RET=1 @@ -101,6 +103,12 @@ _dir_list() if [[ ${RET} -ne 0 ]]; then exit ${RET} fi + + # shellcheck disable=SC2002 + cat "${_DIRS_UNSORTED}" \ + | sort -n \ + | uniq \ + > "${_SEARCH_DIRS}" } _find_shell()