$75 GRAYBYTE WORDPRESS FILE MANAGER $48

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/run-script/lib/

HOME
Current File : /opt/cpanel/ea-nodejs22/lib/node_modules/npm/node_modules/@npmcli/run-script/lib//set-path.js
const { resolve, dirname, delimiter } = require('path')
// the path here is relative, even though it does not need to be
// in order to make the posix tests pass in windows
const nodeGypPath = resolve(__dirname, '../lib/node-gyp-bin')

// Windows typically calls its PATH environ 'Path', but this is not
// guaranteed, nor is it guaranteed to be the only one.  Merge them
// all together in the order they appear in the object.
const setPATH = (projectPath, binPaths, env) => {
  const PATH = Object.keys(env).filter(p => /^path$/i.test(p) && env[p])
    .map(p => env[p].split(delimiter))
    .reduce((set, p) => set.concat(p.filter(concatted => !set.includes(concatted))), [])
    .join(delimiter)

  const pathArr = []
  if (binPaths) {
    pathArr.push(...binPaths)
  }
  // unshift the ./node_modules/.bin from every folder
  // walk up until dirname() does nothing, at the root
  // XXX we should specify a cwd that we don't go above
  let p = projectPath
  let pp
  do {
    pathArr.push(resolve(p, 'node_modules', '.bin'))
    pp = p
    p = dirname(p)
  } while (p !== pp)
  pathArr.push(nodeGypPath, PATH)

  const pathVal = pathArr.join(delimiter)

  // XXX include the node-gyp-bin path somehow?  Probably better for
  // npm or arborist or whoever to just provide that by putting it in
  // the PATH environ, since that's preserved anyway.
  for (const key of Object.keys(env)) {
    if (/^path$/i.test(key)) {
      env[key] = pathVal
    }
  }

  return env
}

module.exports = setPATH

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
node-gyp-bin
--
16 Mar 2026 5.04 PM
root / root
0755
is-server-package.js
0.239 KB
17 Jan 2026 1.16 AM
root / root
0644
make-spawn-args.js
1.104 KB
17 Jan 2026 1.16 AM
root / root
0644
package-envs.js
0.807 KB
17 Jan 2026 1.16 AM
root / root
0644
run-script-pkg.js
2.907 KB
17 Jan 2026 1.16 AM
root / root
0644
run-script.js
0.508 KB
17 Jan 2026 1.16 AM
root / root
0644
set-path.js
1.466 KB
17 Jan 2026 1.16 AM
root / root
0644
signal-manager.js
1.026 KB
17 Jan 2026 1.16 AM
root / root
0644
validate-options.js
1.184 KB
17 Jan 2026 1.16 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF