enigma-bbs/core/config_util.js

18 lines
414 B
JavaScript
Raw Normal View History

2016-01-15 05:56:21 +00:00
/* jslint node: true */
'use strict';
const Config = require('./config.js').get;
// deps
const paths = require('path');
2016-01-15 05:56:21 +00:00
exports.getConfigPath = getConfigPath;
2016-01-15 05:56:21 +00:00
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);
}
return filePath;
}