$67 GRAYBYTE WORDPRESS FILE MANAGER $15

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/alt/alt-nodejs6/root/usr/lib/node_modules/npm/lib/utils/

HOME
Current File : /opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/lib/utils//link.js
module.exports = link
link.ifExists = linkIfExists

var fs = require('graceful-fs')
var chain = require('slide').chain
var mkdir = require('mkdirp')
var rm = require('./gently-rm.js')
var path = require('path')
var npm = require('../npm.js')

function linkIfExists (from, to, gently, cb) {
  fs.stat(from, function (er) {
    if (er) return cb()
    fs.readlink(to, function (er, fromOnDisk) {
      // if the link already exists and matches what we would do,
      // we don't need to do anything
      if (!er) {
        var toDir = path.dirname(to)
        var absoluteFrom = path.resolve(toDir, from)
        var absoluteFromOnDisk = path.resolve(toDir, fromOnDisk)
        if (absoluteFrom === absoluteFromOnDisk) return cb()
      }
      link(from, to, gently, cb)
    })
  })
}

function resolveIfSymlink (maybeSymlinkPath, cb) {
  fs.lstat(maybeSymlinkPath, function (err, stat) {
    if (err) return cb.apply(this, arguments)
    if (!stat.isSymbolicLink()) return cb(null, maybeSymlinkPath)
    fs.readlink(maybeSymlinkPath, cb)
  })
}

function ensureFromIsNotSource (from, to, cb) {
  resolveIfSymlink(from, function (err, fromDestination) {
    if (err) return cb.apply(this, arguments)
    if (path.resolve(path.dirname(from), fromDestination) === path.resolve(to)) {
      return cb(new Error('Link target resolves to the same directory as link source: ' + to))
    }
    cb.apply(this, arguments)
  })
}

function link (from, to, gently, abs, cb) {
  if (typeof cb !== 'function') {
    cb = abs
    abs = false
  }
  if (typeof cb !== 'function') {
    cb = gently
    gently = null
  }
  if (npm.config.get('force')) gently = false

  to = path.resolve(to)
  var toDir = path.dirname(to)
  var absTarget = path.resolve(toDir, from)
  var relativeTarget = path.relative(toDir, absTarget)
  var target = abs ? absTarget : relativeTarget

  chain(
    [
      [ensureFromIsNotSource, absTarget, to],
      [fs, 'stat', absTarget],
      [rm, to, gently],
      [mkdir, path.dirname(to)],
      [fs, 'symlink', target, to, 'junction']
    ],
    cb
  )
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
31 Aug 2024 8.02 AM
root / root
0755
completion
--
31 Aug 2024 8.02 AM
root / root
0755
child-path.js
0.283 KB
28 Sep 2021 4.36 PM
root / root
0644
completion.sh
1.624 KB
28 Sep 2021 4.36 PM
root / root
0755
correct-mkdir.js
3.035 KB
28 Sep 2021 4.36 PM
root / root
0644
deep-sort-object.js
0.414 KB
28 Sep 2021 4.36 PM
root / root
0644
depr-check.js
0.381 KB
28 Sep 2021 4.36 PM
root / root
0644
error-handler.js
4.994 KB
28 Sep 2021 4.36 PM
root / root
0644
error-message.js
9.693 KB
28 Sep 2021 4.36 PM
root / root
0644
escape-arg.js
0.657 KB
28 Sep 2021 4.36 PM
root / root
0644
escape-exec-path.js
0.759 KB
28 Sep 2021 4.36 PM
root / root
0644
gently-rm.js
8.646 KB
28 Sep 2021 4.36 PM
root / root
0644
get-publish-config.js
0.788 KB
28 Sep 2021 4.36 PM
root / root
0644
git.js
1.211 KB
28 Sep 2021 4.36 PM
root / root
0644
is-windows-bash.js
0.126 KB
28 Sep 2021 4.36 PM
root / root
0644
is-windows-shell.js
0.149 KB
28 Sep 2021 4.36 PM
root / root
0644
is-windows.js
0.058 KB
28 Sep 2021 4.36 PM
root / root
0644
lifecycle.js
11.369 KB
28 Sep 2021 4.36 PM
root / root
0644
link.js
2.021 KB
28 Sep 2021 4.36 PM
root / root
0644
locker.js
1.81 KB
28 Sep 2021 4.36 PM
root / root
0644
map-to-registry.js
2.663 KB
28 Sep 2021 4.36 PM
root / root
0644
module-name.js
0.927 KB
28 Sep 2021 4.36 PM
root / root
0644
no-progress-while-running.js
0.528 KB
28 Sep 2021 4.36 PM
root / root
0644
output.js
0.205 KB
28 Sep 2021 4.36 PM
root / root
0644
package-id.js
0.39 KB
28 Sep 2021 4.36 PM
root / root
0644
parse-json.js
0.578 KB
28 Sep 2021 4.36 PM
root / root
0644
pulse-till-done.js
0.416 KB
28 Sep 2021 4.36 PM
root / root
0644
read-local-package.js
0.321 KB
28 Sep 2021 4.36 PM
root / root
0644
rename.js
0.312 KB
28 Sep 2021 4.36 PM
root / root
0644
save-stack.js
0.341 KB
28 Sep 2021 4.36 PM
root / root
0644
spawn.js
1.377 KB
28 Sep 2021 4.36 PM
root / root
0644
tar.js
14.461 KB
28 Sep 2021 4.36 PM
root / root
0644
temp-filename.js
0.169 KB
28 Sep 2021 4.36 PM
root / root
0644
umask.js
0.335 KB
28 Sep 2021 4.36 PM
root / root
0644
usage.js
0.563 KB
28 Sep 2021 4.36 PM
root / root
0644
warn-deprecated.js
0.543 KB
28 Sep 2021 4.36 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF