count
This commit is contained in:
parent
216fe057c9
commit
8982496082
1 changed files with 7 additions and 4 deletions
11
bash/main.sh
11
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}"
|
||||
|
|
Loading…
Reference in a new issue