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
Tags 35.124.0
No related merge requests found
const logger = require('winston'); const logger = require('winston');
const path = require('path');
module.exports = { module.exports = {
getConfig, getConfig,
isPathAbsolute,
}; };
function getConfig(env) { function getConfig(env) {
let configFile = env.RENOVATE_CONFIG_FILE || 'config'; let configFile = env.RENOVATE_CONFIG_FILE || 'config';
if (!isPathAbsolute(configFile)) { if (!path.isAbsolute(configFile)) {
configFile = `../../${configFile}`; configFile = `../../${configFile}`;
} }
let config = {}; let config = {};
...@@ -20,7 +20,3 @@ function getConfig(env) { ...@@ -20,7 +20,3 @@ function getConfig(env) {
} }
return config; 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