����JFIF��� ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20
System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 7.4.20
Disable Function : NONE
Directory :  /home/real/node-v13.0.1/deps/npm/test/tap/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/real/node-v13.0.1/deps/npm/test/tap/install-bin-null.js
var fs = require('graceful-fs')
var path = require('path')

var mkdirp = require('mkdirp')
var osenv = require('osenv')
var rimraf = require('rimraf')
var test = require('tap').test

var common = require('../common-tap.js')

var pkg = common.pkg

var EXEC_OPTS = { cwd: pkg }

var parentPkg = {
  name: 'parent-package',
  version: '0.0.0',
  dependencies: {
    'child-package-a': 'file:./child-package-a',
    'child-package-b': 'file:./child-package-b'
  }
}

var childPkgA = {
  name: 'child-package-a',
  version: '0.0.0',
  bin: 'index.js'
}

var childPkgB = {
  name: 'child-package-b',
  version: '0.0.0',
  dependencies: {
    'grandchild-package': 'file:../grandchild-package'
  }
}

var grandchildPkg = {
  name: 'grandchild-package',
  version: '0.0.0',
  bin: null
}

var pkgs = [childPkgA, childPkgB, grandchildPkg]

test('the grandchild has bin:null', function (t) {
  setup()
  common.npm(['install'], EXEC_OPTS, function (err, code, stdout, stderr) {
    t.ifErr(err, 'npm link finished without error')
    t.equal(code, 0, 'exited ok')
    t.ok(stdout, 'output indicating success')
    t.notOk(stderr, 'no output stderr')
    t.end()
  })
})

test('cleanup', function (t) {
  cleanup()
  t.end()
})

function cleanup () {
  process.chdir(osenv.tmpdir())
  rimraf.sync(pkg)
}

function setup () {
  cleanup()
  mkdirp.sync(pkg)
  fs.writeFileSync(
    path.join(pkg, 'package.json'),
    JSON.stringify(parentPkg, null, 2)
  )
  pkgs.forEach(function (json) {
    process.chdir(mkPkg(json))
  })
  fs.writeFileSync(
    path.join(pkg, childPkgA.name, 'index.js'),
    ''
  )
}

function mkPkg (json) {
  var pkgPath = path.resolve(pkg, json.name)
  mkdirp.sync(pkgPath)
  fs.writeFileSync(
    path.join(pkgPath, 'package.json'),
    JSON.stringify(json, null, 2)
  )
  return pkgPath
}

ZeroDay Forums Mini