From f6421b0bb9cb4b588285574097db9f2d58719db8 Mon Sep 17 00:00:00 2001 From: Hutson Betts <hutson@hyper-expanse.net> Date: Sat, 25 Mar 2017 23:08:34 -0500 Subject: [PATCH] fix(file): use path.isAbsolute for Windows compatibility (#142) Use Node's built-in `path.isAbsolute` for compatibility with Window's file paths. --- lib/config/file.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/config/file.js b/lib/config/file.js index b103f6a9de..56c608effc 100644 --- a/lib/config/file.js +++ b/lib/config/file.js @@ -1,13 +1,13 @@ 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); -} -- GitLab