Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide (or document) an option to ignore directories #11

Closed
KasparEtter opened this issue Mar 12, 2020 · 2 comments
Closed

Provide (or document) an option to ignore directories #11

KasparEtter opened this issue Mar 12, 2020 · 2 comments

Comments

@KasparEtter
Copy link
Contributor

KasparEtter commented Mar 12, 2020

This issue started out as a wish for an enhancement, but, as it turned out, it's also a bug.

When renaming files with rename '*' or rename '**/*', I would like to be able to only rename files but not directories without enforcing any naming conventions. My current workaround is to use rename '**/*.*' because my directories rarely contain periods while all the files I'm interested in typically have a suffix.

Now to the bug part: If you rename with '**/*' files in a subdirectory and the directory itself is also renamed (due to the "limitation" described above), then the command fails on all files in the subdirectory with <filepath> does not exist! Operation skipped.. Ideally, the tool would either rename directories last or keep track of the renames dynamically.

@jhotmann
Copy link
Owner

Fixed in 6.1.0

@KasparEtter
Copy link
Contributor Author

Just for the record: Once #18 is merged to restore previous directory handling, nested renaming including directories (i.e. without using -d) still fails with <filepath> does not exist! Operation skipped.. I leave it up to you whether you want to address this (and reopen this issue until then) or whether the "workaround" (with -d) is good enough. It is good enough for me, it's just not very user-friendly (but probably not trivial to fix). And you wouldn't be able to rename nested directories if you wanted to do so. (An option like --only-directories wouldn't solve this without addressing the underlying problem.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants