Skip to content

Commit

Permalink
fix(utils): Correct createArchive() method and getCompiledHtml()
Browse files Browse the repository at this point in the history
Added a throw within createArchive() if one of the files is not found. Added a return in
getCompiledHtml() so that the code stops its execution.
  • Loading branch information
roux1max committed Oct 8, 2017
1 parent 9c5cc17 commit 4e5c7c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/media.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ module.exports = config => {
return deferred.promise;
},

deleteImage(filePath) {
deleteFile(filePath) {
const deferred = Q.defer();
fse.remove(filePath, err => {
if (err) {
Expand Down Expand Up @@ -139,9 +139,9 @@ module.exports = config => {

// good practice to catch warnings (ie stat failures and other non-blocking errors)
archive.on('warning', err => {
if (err.code === 'ENOENT') {
return log(['warning', 'archive'], err);
}
// if (err.code === 'ENOENT') {
// return log(['warning', 'archive'], err);
// }

output.close();
return reject(err);
Expand Down
2 changes: 1 addition & 1 deletion lib/templater.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports.getCompiledHtml = (templatePath, data) => {
const deferred = Q.defer();
fs.readFile(templatePath, 'utf8', (err, fileContent) => {
if (err) {
deferred.reject(err);
return deferred.reject(err);
}

const compiledHtml = handlebars.compile(fileContent)(data);
Expand Down

0 comments on commit 4e5c7c6

Please sign in to comment.