Fix FileUtils promises

This commit is contained in:
Samuel Elliott 2018-01-25 16:47:13 +00:00
parent 65cf800283
commit d11cfbcdaa
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6
1 changed files with 7 additions and 7 deletions

View File

@ -102,7 +102,7 @@ class FileUtils {
}
static async directoryExists(path) {
return new Promise(resolve => {
return new Promise((resolve, reject) => {
fs.stat(path, (err, stats) => {
if (err) return reject({
'message': `Directory does not exist: ${path}`,
@ -126,7 +126,7 @@ class FileUtils {
throw (err);
}
return new Promise(resolve => {
return new Promise((resolve, reject) => {
fs.readFile(path, 'utf-8', (err, data) => {
if (err) reject({
'message': `Could not read file: ${path}`,
@ -221,4 +221,4 @@ class Filters {
}
};
module.exports = { Logger, Utils, FileUtils, Filters }
module.exports = { Logger, Utils, FileUtils, Filters };