75lb / renamer

Rename files in bulk.
MIT License
529 stars 30 forks source link

Preset the naming method of some files or directories? #52

Closed xianghongai closed 3 years ago

xianghongai commented 3 years ago

Preset some naming schemes?

75lb commented 3 years ago

Use this plugin: https://github.com/75lb/renamer-case...

How to use plugins: https://github.com/75lb/renamer/wiki/How-to-use-replace-chain-plugins

xianghongai commented 3 years ago

renamer

xianghongai commented 3 years ago

ERROR: plugin could not be found: renamer-case

75lb commented 3 years ago

Hi, yes I just spotted this issue myself - renamer is not finding the globally-installed renamer-case plugin.. it should find it, I will fix that now.

In the meantime, please install the plugin package locally like this:

npm install --save-dev renamer-case

If renamer is still installed globally, then run this to test the plugin loads (you will see the plugin is loaded because it shows in the usage guide. )

renamer --chain renamer-case --help 

Rename files - don't forget --dry-run first.

renamer --chain renamer-case --case kebab * --dry-run
xianghongai commented 3 years ago

Windows:

  1. In C:\nodejs\node_global\node_modules\renamer execute the command npm install --save-dev renamer-case;
  2. Move the directories and files that need to be processed to the C:\nodejs\node_global\node_modules\renamer\examples directory, and then renamer --chain renamer-case --case kebab **/*;

Nice! thank you, it helped me a lot.

75lb commented 3 years ago

Thanks, that's good news..

The issue with loading globally-installed plugins has been fixed and released in renamer v3.0.2. With the latest renamer version you will not get the "plugin could not be found" error you saw earlier.