Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.

Commit ae5cda7

Browse files
committed
Fix crash when directory name is all numbers
1 parent 4fb3fd9 commit ae5cda7

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rename-cli",
3-
"version": "6.2.0",
3+
"version": "6.2.1",
44
"description": "A command line utility for renaming files",
55
"main": "rename.js",
66
"preferGlobal": true,

rename.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ function argvToOptions(argv) {
121121

122122
function getFileArray(files) {
123123
files = files.map(f => {
124+
if (Number.isInteger(f)) f = '' + f;
124125
return f.replace(/\[/g, '\\[').replace(/\]/g, '\\]');
125126
});
126127
if (globby.hasMagic(files)) {

0 commit comments

Comments
 (0)