����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/lifecycle-INIT_CWD.js
var fs = require('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 subdir = path.resolve(pkg, 'subdir')

var json = {
  name: 'init-cwd',
  version: '1.0.0',
  scripts: {
    initcwd: process.platform === 'win32' ? 'echo %INIT_CWD%' : 'echo "$INIT_CWD"'
  }
}

test('setup', function (t) {
  cleanup()
  mkdirp.sync(pkg)
  mkdirp.sync(subdir)
  fs.writeFileSync(
    path.join(pkg, 'package.json'),
    JSON.stringify(json, null, 2)
  )

  process.chdir(subdir)
  t.end()
})

test('make sure the env.INIT_CWD is correct', function (t) {
  common.npm(['run-script', 'initcwd'], {
    cwd: subdir
  }, function (er, code, stdout) {
    if (er) throw er
    t.equal(code, 0, 'exit code')
    stdout = stdout.trim().split(/\r|\n/).pop()
    var actual = stdout

    t.equal(actual, subdir)
    t.end()
  })
})

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

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

ZeroDay Forums Mini