]> git.donarmstrong.com Git - bin.git/commitdiff
* update sanitize filename
authorDon Armstrong <don@donarmstrong.com>
Tue, 29 Mar 2011 22:17:11 +0000 (22:17 +0000)
committerDon Armstrong <don@donarmstrong.com>
Tue, 29 Mar 2011 22:17:11 +0000 (22:17 +0000)
sanitize_filename

index fce84936dad1496422fa4b64cf304e8d6b3bcc65..a6dc4c10038315e89ad59dc81d78926dfd32bdc8 100755 (executable)
@@ -25,7 +25,7 @@ while [ $1 != "--" ]; do
 done;
 shift;
 if [ "$ANIME_CUT" == 0 ]; then
-    rename 's/\s+/\_/g; s{[^\w\d.\/]}{\_}g; s/_$//g; $_ = lc($_); s/\_+/\_/g; s/\_\././; s/^_+//g;' -- "$@"
+    rename 's/\s+/\_/g; s{[^\w\d.\/]}{\_}g; s/_$//g; $_ = lc($_); s/\_+/\_/g; s/\_\././; s/^_+//g; s/_+$//g;' -- "$@"
 else
-    rename 's{\[[^\]\/]+\]}{}g; s{\([^\)\/]+\)}{}g; s/\s+/\_/g; $_ = lc($_); s/[_-]+/\_/g; s/\_\././; s/^_+//;' -- "$@"
+    rename 's{\[[^\]\/]+\]}{}g; s{\([^\)\/]+\)}{}g; s/\s+/\_/g; $_ = lc($_); s/[_-]+/\_/g; s/\_\././; s/^_+//; s/_+$//g;' -- "$@"
 fi;
\ No newline at end of file