403Webshell
Server IP : 185.11.201.71  /  Your IP : 192.168.7.18
Web Server : Apache/2.4.29 (Ubuntu)
System : Linux tech-virtual-machine 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
User : tech ( 1000)
PHP Version : 7.4.28
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/node-gyp/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/node-gyp/lib/find-node-directory.js
var path = require('path')
  , log = require('npmlog')

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
  npm_parent_directory = path.join(scriptLocation, '../../../..')
  log.verbose('node-gyp root', 'npm_parent_directory is '
              + path.basename(npm_parent_directory))
  node_root_dir = ""

  log.verbose('node-gyp root', 'Finding node root directory')
  if (path.basename(npm_parent_directory) === 'deps') {
    // We are in a build directory where this script lives in
    // deps/npm/node_modules/node-gyp/lib
    node_root_dir = path.join(npm_parent_directory, '..')
    log.verbose('node-gyp root', 'in build directory, root = '
                + node_root_dir)
  } else if (path.basename(npm_parent_directory) === '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') {
      node_root_dir = path.join(npm_parent_directory, '..')
    } else {
      node_root_dir = path.join(npm_parent_directory, '../..')
    }
    log.verbose('node-gyp root', 'in install directory, root = '
                + node_root_dir)
  } else {
    // We don't know where we are, try working it out from the location
    // of the node binary
    var node_dir = path.dirname(processObj.execPath)
    var directory_up = path.basename(node_dir)
    if (directory_up === 'bin') {
      node_root_dir = path.join(node_dir, '..')
    } else if (directory_up === 'Release' || directory_up === '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') {
        node_root_dir = path.join(node_dir, '..')
      } else {
        node_root_dir = path.join(node_dir, '../..')
      }
    }
    // Else return the default blank, "".
  }
  return node_root_dir
}

module.exports = findNodeDirectory

Youez - 2016 - github.com/yon3zu
LinuXploit