From 5ab927d2f52a40185a9127ad5962da320108122f Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Mon, 29 Jun 2020 22:26:35 -0600 Subject: [PATCH] Better getConfigPath() --- core/config_util.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/config_util.js b/core/config_util.js index 63e46f62..714055dd 100644 --- a/core/config_util.js +++ b/core/config_util.js @@ -9,9 +9,9 @@ const paths = require('path'); exports.getConfigPath = getConfigPath; function getConfigPath(filePath) { - // |filePath| is assumed to be in the config path if it's only a file name - if('.' === paths.dirname(filePath)) { - filePath = paths.join(Config().paths.config, filePath); + if (paths.isAbsolute(filePath)) { + return filePath; } - return filePath; + + return paths.join(Config().paths.config, filePath); }