From 89cdebcf65435ea419bce07fd3c3b09f9e67a490 Mon Sep 17 00:00:00 2001 From: Mohammad Fares Date: Sun, 14 Oct 2018 21:38:38 +0300 Subject: [PATCH] Use utility.resolveFilePath() with utility.loadFile() --- utility.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/utility.js b/utility.js index ca63cb3..ec7130b 100644 --- a/utility.js +++ b/utility.js @@ -69,18 +69,11 @@ function loadFile(filePath, extension) { var content = null; // Resolve the path into an absolute path - filePath = di.path.resolve(filePath); + filePath = resolveFilePath(filePath, extension); // The file doesn't exist if (!isFile(filePath)) { - - // A file with .yml suffix also doesn't exist - if (!isFile(filePath + '.' + extension)) { - throw new Error('The provided file doesn\'t exit'); - } else { - filePath = filePath + '.yml'; - } - + throw new Error('The provided file doesn\'t exit'); } // Read the file