code: function determineTargetDir(source, target) {
  	return stat(source).
  		then(results => results.isDirectory() ? target : path.dirname(target));
  }
docs: If `source` is a directory, `target` is used as target directory - otherwise, `target`'s parent directory is used