name : fix_numbering fix counter.
This commit is contained in:
parent
2bc5285df9
commit
2ece1cfb59
|
@ -487,13 +487,16 @@ function name_fix_numbering() {
|
|||
|
||||
# All files by default.
|
||||
if [[ "${targets[*]}" = "" ]]; then
|
||||
targets=(*)
|
||||
targets=($(ls))
|
||||
total=${#targets[@]}
|
||||
fi
|
||||
|
||||
# Count leading zeroes.
|
||||
local highest=0
|
||||
for target in "${targets[@]}"; do
|
||||
# Check that starts with a digit.
|
||||
[[ "${target}" =~ ^[0-9] ]] || continue
|
||||
|
||||
local digits=($(_parse_ints "${target}"))
|
||||
local digit="${digits[0]}"
|
||||
digit=$((10#${digit}))
|
||||
|
|
Reference in a new issue