Better getConfigPath()

This commit is contained in:
Bryan Ashby 2020-06-29 22:26:35 -06:00
parent ce15511cf1
commit 5ab927d2f5
No known key found for this signature in database
GPG Key ID: B49EB437951D2542
1 changed files with 4 additions and 4 deletions

View File

@ -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 paths.join(Config().paths.config, filePath);
}