count
This commit is contained in:
parent
216fe057c9
commit
8982496082
1 changed files with 7 additions and 4 deletions
|
@ -16,17 +16,20 @@ main_link_bashrc() {
|
||||||
main_import_modules() {
|
main_import_modules() {
|
||||||
local file="${1}"
|
local file="${1}"
|
||||||
if [ -f "${file}" ]; then
|
if [ -f "${file}" ]; then
|
||||||
local ifs module modules path root
|
local count ifs module modules path root
|
||||||
path="$(realpath --canonicalize-existing "${file}")"
|
path="$(realpath --canonicalize-existing "${file}")"
|
||||||
root="$(dirname "${path}")"
|
root="$(dirname "${path}")"
|
||||||
echo
|
|
||||||
echo "${root}"
|
|
||||||
modules="$(find "${root}" -type "f" -name "*.sh" -printf "%P
|
modules="$(find "${root}" -type "f" -name "*.sh" -printf "%P
|
||||||
" | sort)"
|
" | sort)"
|
||||||
ifs="${IFS}"
|
ifs="${IFS}"
|
||||||
IFS="
|
IFS="
|
||||||
"
|
"
|
||||||
|
count=0
|
||||||
|
echo
|
||||||
|
echo "${root}"
|
||||||
for module in ${modules}; do
|
for module in ${modules}; do
|
||||||
|
count=$((count + 1))
|
||||||
|
printf "%02d" "${count}"
|
||||||
echo " ${module%.sh}"
|
echo " ${module%.sh}"
|
||||||
module="${root}/${module}"
|
module="${root}/${module}"
|
||||||
if [ "${module}" != "${path}" ]; then
|
if [ "${module}" != "${path}" ]; then
|
||||||
|
|
Loading…
Reference in a new issue