Skip to content

Commit

Permalink
[0.6.1] fixed issue #1
Browse files Browse the repository at this point in the history
  • Loading branch information
dylansmith committed Jan 25, 2015
1 parent 57e1b4e commit a2a9dea
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ If you are a developer please feel free to get involved and send a pull request
your enhancements or bugfix.
## Release History
* 0.6.1
* fixed https://github.com/dylansmith/node-exif-renamer/issues/1
* 0.6.0
* changed the way the target directory is specified in renaming templates, since the current
approach flattens relative paths when doing recursive renaming. The renaming template now
Expand Down
17 changes: 10 additions & 7 deletions bin/exif-renamer
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var cli = require('cli'),
clr = require('cli-color'),
fs = require('fs'),
path = require('path'),
_ = require('lodash'),
glob = require('glob'),
Handlebars = require('handlebars'),
exifRenamer = require('../lib/exif-renamer')();
Expand All @@ -21,18 +22,20 @@ cli.parse({

cli.main(function(args, options) {

function reporter(err, result) {
function reporter(err, results) {
if (err) {
cli.error(err);
}
else if (result) {
else if (results) {
results = (_.isArray(results)) ? results : [results];
var tmpl = [
clr.cyan('[old] ' + '{{original.path}}'),
clr.green('[new] ' + '{{processed.path}}')
clr.green('[new] ' + '{{processed.path}}\n')
].join('\n');
cli.info((options.dryrun) ? 'dry run ' : 'image renamed');
console.log(Handlebars.compile(tmpl)(result));
console.log('');
results.forEach(function(result) {
cli.info((options.dryrun) ? 'dry run ' : 'image renamed');
console.log(Handlebars.compile(tmpl)(result));
});
}
}

Expand Down Expand Up @@ -74,7 +77,7 @@ cli.main(function(args, options) {
if (!is_dir) {
return cli.fatal('the --recursive option requires a valid directory');
}
exifRenamer.rename_dir(p, options.template, reporter, true);
exifRenamer.rename_dir(p, options.template, true, reporter);
}

else if (options.exif) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "exif-renamer",
"description": "A NodeJS library & shell command to rename photos using their EXIF data.",
"version": "0.6.0",
"version": "0.6.1",
"homepage": "https://github.com/dylansmith/node-exif-renamer",
"author": {
"name": "Dylan Smith",
Expand Down

0 comments on commit a2a9dea

Please sign in to comment.