diff --git a/CHANGELOG.md b/CHANGELOG.md index 2172d10..c028d41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog All notable changes to this project will be documented in this file. +## [0.4.1] +- Better delimiter support + ## [0.4.0] - Initial repo version \ No newline at end of file diff --git a/README.md b/README.md index 3a5e6e5..0dc458d 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ ## Notes Running Rollup requires disabling Gatekeeper by running `sudo spctl --master-disable` in the Terminal. +The following characters are currently supported as delimiters: " ","_","-","+" ## Changelog diff --git a/Rollup.app.zip b/Rollup.app.zip index 721c5d1..d57ef4b 100644 Binary files a/Rollup.app.zip and b/Rollup.app.zip differ diff --git a/Rollup.php b/Rollup.php index a642a13..7356d3b 100755 --- a/Rollup.php +++ b/Rollup.php @@ -23,6 +23,7 @@ $p['etbin'] = __DIR__."/exiftool"; $p['pfiletypes'] = array("jpg","jpeg","dng","heic","png","gif"); $p['vfiletypes'] = array("mov","mp4","m4v"); $p['screenshot_dims'] = array(320,640,750,828,1125,1242); +$p['delimiters'] = array(" ","_","-","+"); // Enable this option to verify newnames against those made with a prior version of rollup @@ -126,9 +127,19 @@ foreach ($files as $file) { $newname = str_replace(array_keys($z),array_values($z),$p['vt']); } - $figureoutabetterwaytodothis_a = array("____","___","__"); - $figureoutabetterwaytodothis_b = array("_","_","_"); - $newname = str_replace($figureoutabetterwaytodothis_a,$figureoutabetterwaytodothis_b,$newname); + // Prevent repeat delimiters from null keys + // The following is a fairly lame hack + + foreach ($p['delimiters'] as $char) { + $d_a[] = $char; + $d_a[] = $char.$char; + $d_a[] = $char.$char.$char; + $d_b[] = $char; + $d_b[] = $char; + $d_b[] = $char; + } + + $newname = str_replace($d_a,$d_b,$newname); if (!@$newname) { echo " -> ERROR\n"; diff --git a/version.txt b/version.txt index 60a2d3e..44bb5d1 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.4.0 \ No newline at end of file +0.4.1 \ No newline at end of file