aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/node-gyp/lib/find-node-directory.js
diff options
context:
space:
mode:
authorpack <pack@packgekko.xyz>2026-08-09 10:54:08 +0000
committerpack <pack@packgekko.xyz>2026-08-09 10:54:08 +0000
commitd3adc16a08d95d6e331de55d7d3bf05a66a874a8 (patch)
treea2dabd199501e67c547c2ce79e1374ca3aa55443 /node_modules/node-gyp/lib/find-node-directory.js
parent55a4f1fc869e41aca748c63d3018f0448b1606e0 (diff)
downloadcrud-d3adc16a08d95d6e331de55d7d3bf05a66a874a8.tar.gz
stop tracking node_modules/
Diffstat (limited to 'node_modules/node-gyp/lib/find-node-directory.js')
-rw-r--r--node_modules/node-gyp/lib/find-node-directory.js63
1 files changed, 0 insertions, 63 deletions
diff --git a/node_modules/node-gyp/lib/find-node-directory.js b/node_modules/node-gyp/lib/find-node-directory.js
deleted file mode 100644
index 8838b81..0000000
--- a/node_modules/node-gyp/lib/find-node-directory.js
+++ /dev/null
@@ -1,63 +0,0 @@
-'use strict'
-
-const path = require('path')
-const log = require('./log')
-
-function findNodeDirectory (scriptLocation, processObj) {
- // set dirname and process if not passed in
- // this facilitates regression tests
- if (scriptLocation === undefined) {
- scriptLocation = __dirname
- }
- if (processObj === undefined) {
- processObj = process
- }
-
- // Have a look to see what is above us, to try and work out where we are
- const npmParentDirectory = path.join(scriptLocation, '../../../..')
- log.verbose('node-gyp root', 'npm_parent_directory is ' +
- path.basename(npmParentDirectory))
- let nodeRootDir = ''
-
- log.verbose('node-gyp root', 'Finding node root directory')
- if (path.basename(npmParentDirectory) === 'deps') {
- // We are in a build directory where this script lives in
- // deps/npm/node_modules/node-gyp/lib
- nodeRootDir = path.join(npmParentDirectory, '..')
- log.verbose('node-gyp root', 'in build directory, root = ' +
- nodeRootDir)
- } else if (path.basename(npmParentDirectory) === 'node_modules') {
- // We are in a node install directory where this script lives in
- // lib/node_modules/npm/node_modules/node-gyp/lib or
- // node_modules/npm/node_modules/node-gyp/lib depending on the
- // platform
- if (processObj.platform === 'win32') {
- nodeRootDir = path.join(npmParentDirectory, '..')
- } else {
- nodeRootDir = path.join(npmParentDirectory, '../..')
- }
- log.verbose('node-gyp root', 'in install directory, root = ' +
- nodeRootDir)
- } else {
- // We don't know where we are, try working it out from the location
- // of the node binary
- const nodeDir = path.dirname(processObj.execPath)
- const directoryUp = path.basename(nodeDir)
- if (directoryUp === 'bin') {
- nodeRootDir = path.join(nodeDir, '..')
- } else if (directoryUp === 'Release' || directoryUp === 'Debug') {
- // If we are a recently built node, and the directory structure
- // is that of a repository. If we are on Windows then we only need
- // to go one level up, everything else, two
- if (processObj.platform === 'win32') {
- nodeRootDir = path.join(nodeDir, '..')
- } else {
- nodeRootDir = path.join(nodeDir, '../..')
- }
- }
- // Else return the default blank, "".
- }
- return nodeRootDir
-}
-
-module.exports = findNodeDirectory