$97 GRAYBYTE WORDPRESS FILE MANAGER $39

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cpanel/ea-nodejs22/lib/node_modules/npm/node_modules/@npmcli/git/lib/

HOME
Current File : /opt/cpanel/ea-nodejs22/lib/node_modules/npm/node_modules/@npmcli/git/lib//opts.js
const fs = require('node:fs')
const os = require('node:os')
const path = require('node:path')
const ini = require('ini')

const gitConfigPath = path.join(os.homedir(), '.gitconfig')

let cachedConfig = null

// Function to load and cache the git config
const loadGitConfig = () => {
  if (cachedConfig === null) {
    try {
      cachedConfig = {}
      if (fs.existsSync(gitConfigPath)) {
        const configContent = fs.readFileSync(gitConfigPath, 'utf-8')
        cachedConfig = ini.parse(configContent)
      }
    } catch (error) {
      cachedConfig = {}
    }
  }
  return cachedConfig
}

const checkGitConfigs = () => {
  const config = loadGitConfig()
  return {
    sshCommandSetInConfig: config?.core?.sshCommand !== undefined,
    askPassSetInConfig: config?.core?.askpass !== undefined,
  }
}

const sshCommandSetInEnv = process.env.GIT_SSH_COMMAND !== undefined
const askPassSetInEnv = process.env.GIT_ASKPASS !== undefined
const { sshCommandSetInConfig, askPassSetInConfig } = checkGitConfigs()

// Values we want to set if they're not already defined by the end user
// This defaults to accepting new ssh host key fingerprints
const finalGitEnv = {
  ...(askPassSetInEnv || askPassSetInConfig ? {} : {
    GIT_ASKPASS: 'echo',
  }),
  ...(sshCommandSetInEnv || sshCommandSetInConfig ? {} : {
    GIT_SSH_COMMAND: 'ssh -oStrictHostKeyChecking=accept-new',
  }),
}

module.exports = (opts = {}) => ({
  stdioString: true,
  ...opts,
  shell: false,
  env: opts.env || { ...finalGitEnv, ...process.env },
})

// Export the loadGitConfig function for testing
module.exports.loadGitConfig = loadGitConfig

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
1 Jan 1970 8.00 AM
root / root
0
clone.js
4.821 KB
17 Jan 2026 1.16 AM
root / root
0644
errors.js
0.565 KB
17 Jan 2026 1.16 AM
root / root
0644
find.js
0.309 KB
17 Jan 2026 1.16 AM
root / root
0644
index.js
0.236 KB
17 Jan 2026 1.16 AM
root / root
0644
is-clean.js
0.217 KB
17 Jan 2026 1.16 AM
root / root
0644
is.js
0.211 KB
17 Jan 2026 1.16 AM
root / root
0644
lines-to-revs.js
3.966 KB
17 Jan 2026 1.16 AM
root / root
0644
make-error.js
0.841 KB
17 Jan 2026 1.16 AM
root / root
0644
opts.js
1.579 KB
17 Jan 2026 1.16 AM
root / root
0644
revs.js
0.509 KB
17 Jan 2026 1.16 AM
root / root
0644
spawn.js
1.272 KB
17 Jan 2026 1.16 AM
root / root
0644
utils.js
0.106 KB
17 Jan 2026 1.16 AM
root / root
0644
which.js
0.331 KB
17 Jan 2026 1.16 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF