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.
|
# All files by default.
|
||||||
if [[ "${targets[*]}" = "" ]]; then
|
if [[ "${targets[*]}" = "" ]]; then
|
||||||
targets=(*)
|
targets=($(ls))
|
||||||
total=${#targets[@]}
|
total=${#targets[@]}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Count leading zeroes.
|
# Count leading zeroes.
|
||||||
local highest=0
|
local highest=0
|
||||||
for target in "${targets[@]}"; do
|
for target in "${targets[@]}"; do
|
||||||
|
# Check that starts with a digit.
|
||||||
|
[[ "${target}" =~ ^[0-9] ]] || continue
|
||||||
|
|
||||||
local digits=($(_parse_ints "${target}"))
|
local digits=($(_parse_ints "${target}"))
|
||||||
local digit="${digits[0]}"
|
local digit="${digits[0]}"
|
||||||
digit=$((10#${digit}))
|
digit=$((10#${digit}))
|
||||||
|
|
Reference in a new issue