@npmcli/config
Advanced tools
Comparing version 5.0.0 to 6.0.0
@@ -5,3 +5,2 @@ // TODO: set the scope config from package.json or explicit cli config | ||
const nopt = require('nopt') | ||
const mkdirp = require('mkdirp-infer-owner') | ||
const mapWorkspaces = require('@npmcli/map-workspaces') | ||
@@ -11,17 +10,12 @@ const rpj = require('read-package-json-fast') | ||
/* istanbul ignore next */ | ||
const myUid = process.getuid && process.getuid() | ||
/* istanbul ignore next */ | ||
const myGid = process.getgid && process.getgid() | ||
const { resolve, dirname, join } = require('path') | ||
const { homedir } = require('os') | ||
const { promisify } = require('util') | ||
const fs = require('fs') | ||
const readFile = promisify(fs.readFile) | ||
const writeFile = promisify(fs.writeFile) | ||
const chmod = promisify(fs.chmod) | ||
const chown = promisify(fs.chown) | ||
const unlink = promisify(fs.unlink) | ||
const stat = promisify(fs.stat) | ||
const { | ||
readFile, | ||
writeFile, | ||
chmod, | ||
unlink, | ||
stat, | ||
mkdir, | ||
} = require('fs/promises') | ||
@@ -736,12 +730,4 @@ const hasOwnProperty = (obj, key) => | ||
const dir = dirname(conf.source) | ||
await mkdirp(dir) | ||
await mkdir(dir, { recursive: true }) | ||
await writeFile(conf.source, iniData, 'utf8') | ||
// don't leave a root-owned config file lying around | ||
/* istanbul ignore if - this is best-effort and a pita to test */ | ||
if (myUid === 0) { | ||
const st = await stat(dir).catch(() => null) | ||
if (st && (st.uid !== myUid || st.gid !== myGid)) { | ||
await chown(conf.source, st.uid, st.gid).catch(() => {}) | ||
} | ||
} | ||
const mode = where === 'user' ? 0o600 : 0o666 | ||
@@ -748,0 +734,0 @@ await chmod(conf.source, mode) |
{ | ||
"name": "@npmcli/config", | ||
"version": "5.0.0", | ||
"version": "6.0.0", | ||
"files": [ | ||
@@ -35,3 +35,3 @@ "bin/", | ||
"@npmcli/eslint-config": "^3.0.1", | ||
"@npmcli/template-oss": "4.5.0", | ||
"@npmcli/template-oss": "4.5.1", | ||
"tap": "^16.0.1" | ||
@@ -42,6 +42,5 @@ }, | ||
"ini": "^3.0.0", | ||
"mkdirp-infer-owner": "^2.0.0", | ||
"nopt": "^6.0.0", | ||
"proc-log": "^2.0.0", | ||
"read-package-json-fast": "^2.0.3", | ||
"read-package-json-fast": "^3.0.0", | ||
"semver": "^7.3.5", | ||
@@ -55,4 +54,4 @@ "walk-up-path": "^1.0.0" | ||
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", | ||
"version": "4.5.0" | ||
"version": "4.5.1" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
7
50089
1105
+ Addedjson-parse-even-better-errors@3.0.2(transitive)
+ Addednpm-normalize-package-bin@3.0.1(transitive)
+ Addedread-package-json-fast@3.0.2(transitive)
- Removedmkdirp-infer-owner@^2.0.0
- Removedchownr@2.0.0(transitive)
- Removedinfer-owner@1.0.4(transitive)
- Removedmkdirp@1.0.4(transitive)
- Removedmkdirp-infer-owner@2.0.0(transitive)