Skip to content
Snippets Groups Projects
Commit f6421b0b authored by Hutson Betts's avatar Hutson Betts Committed by Rhys Arkins
Browse files

fix(file): use path.isAbsolute for Windows compatibility (#142)

Use Node's built-in `path.isAbsolute` for compatibility with
Window's file paths.
parent c257717e
No related branches found
No related tags found
No related merge requests found
const logger = require('winston');
const path = require('path');
module.exports = {
getConfig,
isPathAbsolute,
};
function getConfig(env) {
let configFile = env.RENOVATE_CONFIG_FILE || 'config';
if (!isPathAbsolute(configFile)) {
if (!path.isAbsolute(configFile)) {
configFile = `../../${configFile}`;
}
let config = {};
......@@ -20,7 +20,3 @@ function getConfig(env) {
}
return config;
}
function isPathAbsolute(path) {
return /^(?:\/|[a-z]+:\/\/)/.test(path);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment