75lb / renamer

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

Dry-run doesn't log anything #42

Closed mhelvens closed 5 years ago

mhelvens commented 5 years ago

I see there is already an issue with almost this title, but that was probably for the previous version. Looking at the source-code, I don't know how dry-run could log any output, because the dryRunLog from rename-file.js is written to, but never read.

75lb commented 5 years ago

hi, could you send some more info to help reproduce this because it works fine for me with the latest version on macOS.. which version of renamer and which OS are you using?

75lb commented 5 years ago

can you also send an example command which fails please

mhelvens commented 5 years ago

I'm using version 1.1.0 as an api, quite like in this test.

Can I ask what is supposed to happen when you use the dryRun flag? For me it simply does nothing. So far so good, nothing is renamed. But I was also expecting to see a list of everything that would be renamed if removed the flag (isn't that what would make a dry run useful?). But I don't see any place in the code where this could happen, and the unit tests don't expect it either.

75lb commented 5 years ago

ah, ok - you're using the API directly.. have you had a look at this wiki page? The Renamer class is not tightly-bound to the console or any view by default (however, the renamer cli is of course). Renamer is observable, you subscribe to the replace-result event and print output in the manner that suits your host application.

mhelvens commented 5 years ago

Makes sense. Thanks!