From 2ece1cfb59225753292d87dfbae0e0952dfcf4b8 Mon Sep 17 00:00:00 2001 From: phone Date: Sun, 10 Dec 2023 07:26:04 +0300 Subject: [PATCH] name : fix_numbering fix counter. --- .config/bash/module/name.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.config/bash/module/name.sh b/.config/bash/module/name.sh index e815978..ad45a88 100644 --- a/.config/bash/module/name.sh +++ b/.config/bash/module/name.sh @@ -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}))