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

fix: avoid common illegal filename characters #110

Merged
merged 1 commit into from
Apr 13, 2023
Merged

fix: avoid common illegal filename characters #110

merged 1 commit into from
Apr 13, 2023

Conversation

LangLangBart
Copy link
Contributor

description

tool

# http://plasmasturm.org/code/rename/
rename --expr "s/'//g;y/-/_/" --force --nometa --nows --lower-case --expr "s/_\./\./" maps/*/*.{pmp,xml}
# s/'//g: remove single quotes "at_world's_end.xml" => "at_worlds_end.xml"
# y/-/_/: replace hyphens with an underscore
# --force: needed for files where the only change is lowercase "Alpine_stef.xml" => "alpine_stef.xml"
# --nometa: replace shell meta-character with underscore, e.g. Pipe (|), Ampersand (&), Semicolon (;), ...
# --nows: replace whitespace with underscore
# --lower-case: :)
# s/_\./\./: remove underscores before the file name ends "temple_4_.xml" => "temple_4.xml"
# maps/*/*.{pmp,xml}: apply it to all files that fit the glob (some files could have "DELETED" at the end)

optional

  • check new files with a regex

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.

2 participants