Skip to content

Commit

Permalink
fpm: fix circular dependency with config stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Nov 27, 2018
1 parent f27ff97 commit 9307703
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/fetch-package-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const rimraf = require('rimraf')
const validate = require('aproba')
const npa = require('npm-package-arg')
const npm = require('./npm')
const npmConfig = require('./config/figgy-config.js')
let npmConfig
const npmlog = require('npmlog')
const limit = require('call-limit')
const tempFilename = require('./utils/temp-filename')
Expand Down Expand Up @@ -52,6 +52,9 @@ function fetchPackageMetadata (spec, where, opts, done) {
err.code = 'EWINDOWSPATH'
return logAndFinish(err)
}
if (!npmConfig) {
npmConfig = require('./config/figgy-config.js')
}
pacote.manifest(dep, npmConfig({
annotate: true,
fullMetadata: opts.fullMetadata,
Expand Down Expand Up @@ -95,6 +98,9 @@ function addBundled (pkg, next) {
}
pkg._bundled = null
const target = tempFilename('unpack')
if (!npmConfig) {
npmConfig = require('./config/figgy-config.js')
}
const opts = npmConfig({integrity: pkg._integrity})
pacote.extract(pkg._resolved || pkg._requested || npa.resolve(pkg.name, pkg.version), target, opts).then(() => {
log.silly('addBundled', 'read tarball')
Expand Down

0 comments on commit 9307703

Please sign in to comment.