const logger = require('winston');

module.exports = {
  getConfig,
  isPathAbsolute,
};

function getConfig(env) {
  let configFile = env.RENOVATE_CONFIG_FILE || 'config';
  if (!isPathAbsolute(configFile)) {
    configFile = `../../${configFile}`;
  }
  let config = {};
  try {
    // eslint-disable-next-line global-require,import/no-dynamic-require
    config = require(configFile);
  } catch (err) {
    // Do nothing
    logger.verbose('Could not locate config file');
  }
  return config;
}

function isPathAbsolute(path) {
  return /^(?:\/|[a-z]+:\/\/)/.test(path);
}

@@ -27,16 +27,46 @@
 nston');
+%0Aconst path = require('path');
 %0A%0Amodule
@@ -95,26 +95,8 @@
 ig,%0A
-  isPathAbsolute,%0A
 %7D;%0A%0A
@@ -185,22 +185,23 @@
 %0A  if (!
-isPath
+path.is
 Absolute
@@ -509,82 +509,4 @@
 ;%0A%7D%0A
-%0Afunction isPathAbsolute(path) %7B%0A  return /%5E(?:%5C/%7C%5Ba-z%5D+:%5C/%5C/)/.test(path);%0A%7D%0A

use path.isAbsolute for Windows compatibility (#142)