Skip to content

Commit 9307703

Browse files
committed
fpm: fix circular dependency with config stuff
1 parent f27ff97 commit 9307703

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/fetch-package-metadata.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const rimraf = require('rimraf')
88
const validate = require('aproba')
99
const npa = require('npm-package-arg')
1010
const npm = require('./npm')
11-
const npmConfig = require('./config/figgy-config.js')
11+
let npmConfig
1212
const npmlog = require('npmlog')
1313
const limit = require('call-limit')
1414
const tempFilename = require('./utils/temp-filename')
@@ -52,6 +52,9 @@ function fetchPackageMetadata (spec, where, opts, done) {
5252
err.code = 'EWINDOWSPATH'
5353
return logAndFinish(err)
5454
}
55+
if (!npmConfig) {
56+
npmConfig = require('./config/figgy-config.js')
57+
}
5558
pacote.manifest(dep, npmConfig({
5659
annotate: true,
5760
fullMetadata: opts.fullMetadata,
@@ -95,6 +98,9 @@ function addBundled (pkg, next) {
9598
}
9699
pkg._bundled = null
97100
const target = tempFilename('unpack')
101+
if (!npmConfig) {
102+
npmConfig = require('./config/figgy-config.js')
103+
}
98104
const opts = npmConfig({integrity: pkg._integrity})
99105
pacote.extract(pkg._resolved || pkg._requested || npa.resolve(pkg.name, pkg.version), target, opts).then(() => {
100106
log.silly('addBundled', 'read tarball')

0 commit comments

Comments
 (0)