aboutsummaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/gentle-fs
diff options
context:
space:
mode:
authorclaudiahdz <cghr1990@gmail.com>2019-09-03 17:51:04 -0500
committerRich Trott <rtrott@gmail.com>2019-09-17 18:51:21 -0700
commit17e420b23f5462db9f1951d98233fdaee889c721 (patch)
treec0f855138f734517aeba81000ebeac9d6e271563 /deps/npm/node_modules/gentle-fs
parent7fa03b54c88f930d24f2f0e2ceb0e94dc5a6ad77 (diff)
downloadandroid-node-v8-17e420b23f5462db9f1951d98233fdaee889c721.tar.gz
android-node-v8-17e420b23f5462db9f1951d98233fdaee889c721.tar.bz2
android-node-v8-17e420b23f5462db9f1951d98233fdaee889c721.zip
deps: update npm to 6.11.3
PR-URL: https://github.com/nodejs/node/pull/29430 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'deps/npm/node_modules/gentle-fs')
-rw-r--r--deps/npm/node_modules/gentle-fs/CHANGELOG.md35
-rw-r--r--deps/npm/node_modules/gentle-fs/index.js4
-rw-r--r--deps/npm/node_modules/gentle-fs/lib/chown.js24
-rw-r--r--deps/npm/node_modules/gentle-fs/lib/link.js30
-rw-r--r--deps/npm/node_modules/gentle-fs/lib/mkdir.js22
-rw-r--r--deps/npm/node_modules/gentle-fs/package.json32
6 files changed, 119 insertions, 28 deletions
diff --git a/deps/npm/node_modules/gentle-fs/CHANGELOG.md b/deps/npm/node_modules/gentle-fs/CHANGELOG.md
index e9bb23d98b..38fc91cba5 100644
--- a/deps/npm/node_modules/gentle-fs/CHANGELOG.md
+++ b/deps/npm/node_modules/gentle-fs/CHANGELOG.md
@@ -2,6 +2,41 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+<a name="2.2.1"></a>
+## [2.2.1](https://github.com/npm/gentle-fs/compare/v2.2.0...v2.2.1) (2019-08-15)
+
+
+### Bug Fixes
+
+* **link:** properly detect that we should chown the link ([1c69beb](https://github.com/npm/gentle-fs/commit/1c69beb))
+
+
+
+<a name="2.2.0"></a>
+# [2.2.0](https://github.com/npm/gentle-fs/compare/v2.1.0...v2.2.0) (2019-08-14)
+
+
+### Bug Fixes
+
+* don't chown if we didn't make any dirs ([c4df8a8](https://github.com/npm/gentle-fs/commit/c4df8a8))
+
+
+### Features
+
+* export mkdir method ([4891c09](https://github.com/npm/gentle-fs/commit/4891c09))
+
+
+
+<a name="2.1.0"></a>
+# [2.1.0](https://github.com/npm/gentle-fs/compare/v2.0.1...v2.1.0) (2019-08-14)
+
+
+### Features
+
+* infer ownership of created dirs and links ([0dd2879](https://github.com/npm/gentle-fs/commit/0dd2879))
+
+
+
<a name="2.0.1"></a>
## [2.0.1](https://github.com/npm/gentle-fs/compare/v2.0.0...v2.0.1) (2017-11-28)
diff --git a/deps/npm/node_modules/gentle-fs/index.js b/deps/npm/node_modules/gentle-fs/index.js
index 2828fdb2bd..9807ed9d85 100644
--- a/deps/npm/node_modules/gentle-fs/index.js
+++ b/deps/npm/node_modules/gentle-fs/index.js
@@ -2,9 +2,11 @@
const rm = require('./lib/rm.js')
const link = require('./lib/link.js')
+const mkdir = require('./lib/mkdir.js')
exports = module.exports = {
rm: rm,
link: link.link,
- linkIfExists: link.linkIfExists
+ linkIfExists: link.linkIfExists,
+ mkdir: mkdir
}
diff --git a/deps/npm/node_modules/gentle-fs/lib/chown.js b/deps/npm/node_modules/gentle-fs/lib/chown.js
new file mode 100644
index 0000000000..5921e56345
--- /dev/null
+++ b/deps/npm/node_modules/gentle-fs/lib/chown.js
@@ -0,0 +1,24 @@
+'use strict'
+
+// A module for chowning things we just created, to preserve
+// ownership of new links and directories.
+
+const chownr = require('chownr')
+
+const selfOwner = {
+ uid: process.getuid && process.getuid(),
+ gid: process.getgid && process.getgid()
+}
+
+module.exports = (path, uid, gid, cb) => {
+ if (selfOwner.uid !== 0 ||
+ uid === undefined || gid === undefined ||
+ (selfOwner.uid === uid && selfOwner.gid === gid)) {
+ // don't need to, or can't chown anyway, so just leave it.
+ // this also handles platforms where process.getuid is undefined
+ return cb()
+ }
+ chownr(path, uid, gid, cb)
+}
+
+module.exports.selfOwner = selfOwner
diff --git a/deps/npm/node_modules/gentle-fs/lib/link.js b/deps/npm/node_modules/gentle-fs/lib/link.js
index 246d801479..4623e7e82c 100644
--- a/deps/npm/node_modules/gentle-fs/lib/link.js
+++ b/deps/npm/node_modules/gentle-fs/lib/link.js
@@ -3,8 +3,10 @@
const path = require('path')
const fs = require('graceful-fs')
const chain = require('slide').chain
-const mkdir = require('mkdirp')
+const mkdir = require('./mkdir.js')
const rm = require('./rm.js')
+const inferOwner = require('infer-owner')
+const chown = require('./chown.js')
exports = module.exports = {
link: link,
@@ -53,14 +55,20 @@ function link (from, to, opts, cb) {
var relativeTarget = path.relative(opts.base, absTarget)
var target = opts.absolute ? absTarget : relativeTarget
- chain(
- [
- [ensureFromIsNotSource, absTarget, to],
- [fs, 'stat', absTarget],
- [rm, to, opts],
- [mkdir, path.dirname(to)],
- [fs, 'symlink', target, to, 'junction']
- ],
- cb
- )
+ const tasks = [
+ [ensureFromIsNotSource, absTarget, to],
+ [fs, 'stat', absTarget],
+ [rm, to, opts],
+ [mkdir, path.dirname(to)],
+ [fs, 'symlink', target, to, 'junction']
+ ]
+
+ if (chown.selfOwner.uid !== 0) {
+ chain(tasks, cb)
+ } else {
+ inferOwner(to).then(owner => {
+ tasks.push([chown, to, owner.uid, owner.gid])
+ chain(tasks, cb)
+ })
+ }
}
diff --git a/deps/npm/node_modules/gentle-fs/lib/mkdir.js b/deps/npm/node_modules/gentle-fs/lib/mkdir.js
new file mode 100644
index 0000000000..5b41995971
--- /dev/null
+++ b/deps/npm/node_modules/gentle-fs/lib/mkdir.js
@@ -0,0 +1,22 @@
+'use strict'
+
+const mkdirp = require('mkdirp')
+const inferOwner = require('infer-owner')
+const chown = require('./chown.js')
+
+module.exports = (path, cb) => {
+ // don't bother chowning if we can't anyway
+ if (process.platform === 'win32' || chown.selfOwner.uid !== 0) {
+ return mkdirp(path, cb)
+ }
+
+ inferOwner(path).then(owner => {
+ mkdirp(path, (er, made) => {
+ if (er || !made) {
+ cb(er, made)
+ } else {
+ chown(made || path, owner.uid, owner.gid, cb)
+ }
+ })
+ }, cb)
+}
diff --git a/deps/npm/node_modules/gentle-fs/package.json b/deps/npm/node_modules/gentle-fs/package.json
index 55bc6bd40e..bf4867c08d 100644
--- a/deps/npm/node_modules/gentle-fs/package.json
+++ b/deps/npm/node_modules/gentle-fs/package.json
@@ -1,49 +1,49 @@
{
- "_args": [
- [
- "gentle-fs@2.0.1",
- "/Users/rebecca/code/npm"
- ]
- ],
- "_from": "gentle-fs@2.0.1",
- "_id": "gentle-fs@2.0.1",
+ "_from": "gentle-fs@2.2.1",
+ "_id": "gentle-fs@2.2.1",
"_inBundle": false,
- "_integrity": "sha512-cEng5+3fuARewXktTEGbwsktcldA+YsnUEaXZwcK/3pjSE1X9ObnTs+/8rYf8s+RnIcQm2D5x3rwpN7Zom8Bew==",
+ "_integrity": "sha512-e7dRgUM5fsS+7wm2oggZpgcRx6sEvJHXujPH5RzgQ1ziQY4+HuVBYsnUzJwJ+C7mjOJN27DjiFy1TaL+TNltow==",
"_location": "/gentle-fs",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
- "raw": "gentle-fs@2.0.1",
+ "raw": "gentle-fs@2.2.1",
"name": "gentle-fs",
"escapedName": "gentle-fs",
- "rawSpec": "2.0.1",
+ "rawSpec": "2.2.1",
"saveSpec": null,
- "fetchSpec": "2.0.1"
+ "fetchSpec": "2.2.1"
},
"_requiredBy": [
+ "#USER",
"/",
"/bin-links"
],
- "_resolved": "https://registry.npmjs.org/gentle-fs/-/gentle-fs-2.0.1.tgz",
- "_spec": "2.0.1",
- "_where": "/Users/rebecca/code/npm",
+ "_resolved": "https://registry.npmjs.org/gentle-fs/-/gentle-fs-2.2.1.tgz",
+ "_shasum": "1f38df4b4ead685566257201fd526de401ebb215",
+ "_spec": "gentle-fs@2.2.1",
+ "_where": "/Users/isaacs/dev/npm/cli",
"author": {
"name": "Mike Sherov"
},
"bugs": {
"url": "https://github.com/npm/gentle-fs/issues"
},
+ "bundleDependencies": false,
"dependencies": {
"aproba": "^1.1.2",
+ "chownr": "^1.1.2",
"fs-vacuum": "^1.2.10",
"graceful-fs": "^4.1.11",
"iferr": "^0.1.5",
+ "infer-owner": "^1.0.4",
"mkdirp": "^0.5.1",
"path-is-inside": "^1.0.2",
"read-cmd-shim": "^1.0.1",
"slide": "^1.1.6"
},
+ "deprecated": false,
"description": "Gentle Filesystem operations",
"devDependencies": {
"dezalgo": "^1.0.3",
@@ -81,5 +81,5 @@
"update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'",
"update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'"
},
- "version": "2.0.1"
+ "version": "2.2.1"
}