renamer-index-dir
v2.0.1
Published
Replaces the {{index}} token, resetting the counter for each folder visited.
Downloads
18
Maintainers
Readme
renamer-index-dir
This is a renamer replace chain plugin - see this tutorial to learn how to use renamer plugins.
Replaces the {{index}}
token (like the built-in renamer behaviour) but resets the counter for each folder visited.
In the example below, Windows users should use double instead of single quotes. Remove the --dry-run
flag to rename the files on disk.
$ npm install -g renamer renamer-index-dir
$ tree
.
├── folder1
│ ├── one
│ └── two
├── folder2
│ ├── one
│ └── two
├── one
└── two
2 directories, 6 files
$ renamer --chain find-replace --chain renamer-index-dir --find '/$/' --replace '{{index}}' --dry-run */*
✔︎ folder1/one → folder1/one1
✔︎ folder1/two → folder1/two2
✔︎ folder2/one → folder2/one1
✔︎ folder2/two → folder2/two2
$ tree
.
├── folder1
│ ├── one1
│ └── two2
├── folder2
│ ├── one1
│ └── two2
├── one
└── two
2 directories, 6 files
© 2018-21 Lloyd Brookes [email protected].