diff --git a/bash/main.sh b/bash/main.sh index 9125fc9..b809dfe 100644 --- a/bash/main.sh +++ b/bash/main.sh @@ -16,18 +16,21 @@ main_link_bashrc() { main_import_modules() { local file="${1}" if [ -f "${file}" ]; then - local ifs module modules path root + local count ifs module modules path root path="$(realpath --canonicalize-existing "${file}")" root="$(dirname "${path}")" - echo - echo "${root}" modules="$(find "${root}" -type "f" -name "*.sh" -printf "%P " | sort)" ifs="${IFS}" IFS=" " + count=0 + echo + echo "${root}" for module in ${modules}; do - echo "${module%.sh}" + count=$((count + 1)) + printf "%02d" "${count}" + echo " ${module%.sh}" module="${root}/${module}" if [ "${module}" != "${path}" ]; then . "${module}"