Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/cacache/lib/util')
-rw-r--r--node_modules/cacache/lib/util/disposer.js3
-rw-r--r--node_modules/cacache/lib/util/fix-owner.js18
-rw-r--r--node_modules/cacache/lib/util/move-file.js6
3 files changed, 18 insertions, 9 deletions
diff --git a/node_modules/cacache/lib/util/disposer.js b/node_modules/cacache/lib/util/disposer.js
index aa8aed54d..52d7d3edd 100644
--- a/node_modules/cacache/lib/util/disposer.js
+++ b/node_modules/cacache/lib/util/disposer.js
@@ -8,8 +8,9 @@ function disposer (creatorFn, disposerFn, fn) {
.then(
// disposer resolved, do something with original fn's promise
() => {
- if (shouldThrow)
+ if (shouldThrow) {
throw result
+ }
return result
},
diff --git a/node_modules/cacache/lib/util/fix-owner.js b/node_modules/cacache/lib/util/fix-owner.js
index 90ffece52..bc14def4e 100644
--- a/node_modules/cacache/lib/util/fix-owner.js
+++ b/node_modules/cacache/lib/util/fix-owner.js
@@ -49,8 +49,9 @@ function fixOwner (cache, filepath) {
const { uid, gid } = owner
// No need to override if it's already what we used.
- if (self.uid === uid && self.gid === gid)
+ if (self.uid === uid && self.gid === gid) {
return
+ }
return inflight('fixOwner: fixing ownership on ' + filepath, () =>
chownr(
@@ -58,8 +59,9 @@ function fixOwner (cache, filepath) {
typeof uid === 'number' ? uid : self.uid,
typeof gid === 'number' ? gid : self.gid
).catch((err) => {
- if (err.code === 'ENOENT')
+ if (err.code === 'ENOENT') {
return null
+ }
throw err
})
@@ -93,8 +95,9 @@ function fixOwnerSync (cache, filepath) {
)
} catch (err) {
// only catch ENOENT, any other error is a problem.
- if (err.code === 'ENOENT')
+ if (err.code === 'ENOENT') {
return null
+ }
throw err
}
@@ -110,12 +113,14 @@ function mkdirfix (cache, p, cb) {
return Promise.resolve(inferOwner(cache)).then(() => {
return mkdirp(p)
.then((made) => {
- if (made)
+ if (made) {
return fixOwner(cache, made).then(() => made)
+ }
})
.catch((err) => {
- if (err.code === 'EEXIST')
+ if (err.code === 'EEXIST') {
return fixOwner(cache, p).then(() => null)
+ }
throw err
})
@@ -136,7 +141,8 @@ function mkdirfixSync (cache, p) {
if (err.code === 'EEXIST') {
fixOwnerSync(cache, p)
return null
- } else
+ } else {
throw err
+ }
}
}
diff --git a/node_modules/cacache/lib/util/move-file.js b/node_modules/cacache/lib/util/move-file.js
index c3f9e35eb..3739cea3d 100644
--- a/node_modules/cacache/lib/util/move-file.js
+++ b/node_modules/cacache/lib/util/move-file.js
@@ -38,10 +38,12 @@ function moveFile (src, dest) {
} else if (err.code === 'EEXIST' || err.code === 'EBUSY') {
// file already exists, so whatever
return resolve()
- } else
+ } else {
return reject(err)
- } else
+ }
+ } else {
return resolve()
+ }
})
})
.then(() => {