2016-01-15 05:56:21 +00:00
|
|
|
/* jslint node: true */
|
|
|
|
'use strict';
|
2018-06-14 03:02:00 +00:00
|
|
|
|
2020-06-17 06:10:51 +00:00
|
|
|
const Config = require('./config.js').get;
|
2018-06-14 03:02:00 +00:00
|
|
|
|
2018-06-23 03:26:46 +00:00
|
|
|
// deps
|
2020-06-17 06:10:51 +00:00
|
|
|
const paths = require('path');
|
2016-01-15 05:56:21 +00:00
|
|
|
|
2020-06-17 06:10:51 +00:00
|
|
|
exports.getConfigPath = getConfigPath;
|
2016-01-15 05:56:21 +00:00
|
|
|
|
2018-06-14 03:02:00 +00:00
|
|
|
function getConfigPath(filePath) {
|
2018-06-23 03:26:46 +00:00
|
|
|
// |filePath| is assumed to be in the config path if it's only a file name
|
2018-06-22 05:15:04 +00:00
|
|
|
if('.' === paths.dirname(filePath)) {
|
|
|
|
filePath = paths.join(Config().paths.config, filePath);
|
|
|
|
}
|
|
|
|
return filePath;
|
2018-06-14 03:02:00 +00:00
|
|
|
}
|