HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/shop.komma.nl/node_modules/git-config-path/index.js
/*!
 * git-config-path <https://github.com/jonschlinkert/git-config-path>
 *
 * Copyright (c) 2015, Jon Schlinkert.
 * Licensed under the MIT License.
 */

'use strict';

var path = require('path');
var exists = require('fs-exists-sync');
var extend = require('extend-shallow');
var homedir = require('homedir-polyfill');

module.exports = function(type, options) {
  if (typeof type !== 'string') {
    options = type;
    type = null;
  }

  var opts = extend({cwd: process.cwd()}, options);
  type = type || opts.type;

  var configPath = path.resolve(opts.cwd, '.git/config');
  if (type === 'global') {
    configPath = path.join(homedir(), '.gitconfig');
  }

  if (!exists(configPath)) {
    if (typeof type === 'string') {
      return null;
    }
    configPath = path.join(homedir(), '.config/git/config');
  }

  return exists(configPath) ? configPath : null;
};