PHP 8.2.30
Preview: which.js Size: 339 B
/opt/alt/alt-nodejs20/root/lib/node_modules/npm/node_modules.bundled/@npmcli/git/lib/which.js

const which = require('which')

let gitPath
try {
  gitPath = which.sync('git')
} catch {
  // ignore errors
}

module.exports = (opts = {}) => {
  if (opts.git) {
    return opts.git
  }
  if (!gitPath || opts.git === false) {
    return Object.assign(new Error('No git binary found in $PATH'), { code: 'ENOGIT' })
  }
  return gitPath
}

Directory Contents

Dirs: 0 × Files: 13

Name Size Perms Modified Actions
4.82 KB lrw-r--r-- 2026-02-23 03:24:42
Edit Download
579 B lrw-r--r-- 2026-02-23 03:24:42
Edit Download
316 B lrw-r--r-- 2026-02-23 03:24:42
Edit Download
242 B lrw-r--r-- 2026-02-23 03:24:42
Edit Download
222 B lrw-r--r-- 2026-02-23 03:24:42
Edit Download
216 B lrw-r--r-- 2026-02-23 03:24:42
Edit Download
3.97 KB lrw-r--r-- 2026-02-23 03:24:42
Edit Download
861 B lrw-r--r-- 2026-02-23 03:24:42
Edit Download
1.58 KB lrw-r--r-- 2026-02-23 03:24:42
Edit Download
652 B lrw-r--r-- 2026-02-23 03:24:42
Edit Download
1.27 KB lrw-r--r-- 2026-02-23 03:24:42
Edit Download
109 B lrw-r--r-- 2026-02-23 03:24:42
Edit Download
339 B lrw-r--r-- 2026-02-23 03:24:42
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).