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

left blank lines in order to dont move them #5

Closed
wants to merge 1 commit into from

Conversation

Marinofull
Copy link

If you decide to dont rename some files after opened, just put a -. Example:

Rick and Morty S01E01.mkv
Rick and Morty S01E02.mkv
-
Rick and Morty S01E04.mkv
Rick and Morty S01E05.mkv
Rick and Morty S02E01.mkv

It'll became this

S01E01.mkv
S01E02.mkv
Rick and Morty S01E03.mkv
S01E04.mkv
S01E05.mkv
S02E01.mkv

@olmokramer
Copy link

But what if you'd want to rename a file to - (for some bizarre reason)? I'd suggest checking for empty lines instead.

@Marinofull
Copy link
Author

@olmokramer hmmm.. I tried this before, but if the command IFS=$'\r\n' GLOBIGNORE='*' command eval 'dest=($(cat /tmp/vimv.$$))' found five lines, where one of them is empty, the array dest will have a length == 4, and will messup the renaming.

Do you have another idea?

@thameera
Copy link
Owner

Why not simply keep the line unchanged?
For the sake of keeping the tool simple, I'm going to skip this change. But feel free to open a new PR if you can think of a better flow for this or any new improvement you can think of!

@thameera thameera closed this Aug 22, 2017
@olmokramer
Copy link

@Marinofull hmm interesting... I think

dest=()
while IFS= read -r line; do
    dest=("${dest[@]}" "$line")
done </tmp/vimv.$$

should do the job.

@thameera The use case I could think of is that halfway through renaming a bunch of files you realize you renamed a file you didn't want to rename. It would be nice to be able to make vimv ignore the change without having to look up the current name of the file (because, you know, we are lazy :).)

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

Successfully merging this pull request may close these issues.

3 participants