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}))