Skip to content

Commit efc6786

Browse files
nlfdarcyclarke
authored andcommitted
fix: make sure publishConfig is passed through
1 parent 1e4e6e9 commit efc6786

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/publish.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ const publish_ = async (arg, opts) => {
6969
// The purpose of re-reading the manifest is in case it changed,
7070
// so that we send the latest and greatest thing to the registry
7171
manifest = await readJson(`${arg}/package.json`)
72-
await otplease(opts, opts => libpub(arg, manifest, opts))
72+
const { publishConfig } = manifest
73+
await otplease(opts, opts => libpub(arg, manifest, { ...opts, publishConfig }))
7374
}
7475

7576
// publish

test/lib/publish.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ const { test, cleanSnapshot } = require('tap')
22
const requireInject = require('require-inject')
33

44
test('should publish with libnpmpublish', (t) => {
5+
const publishConfig = { registry: 'https://some.registry' }
56
const testDir = t.testdir({
67
'package.json': JSON.stringify({
78
name: 'my-cool-pkg',
8-
version: '1.0.0'
9+
version: '1.0.0',
10+
publishConfig
911
}, null, 2)
1012
})
1113

@@ -32,6 +34,7 @@ test('should publish with libnpmpublish', (t) => {
3234
t.ok(arg, 'gets path')
3335
t.ok(manifest, 'gets manifest')
3436
t.ok(opts, 'gets opts object')
37+
t.same(opts.publishConfig, publishConfig, 'publishConfig is passed through')
3538
t.ok(true, 'libnpmpublish is called')
3639
}
3740
},

0 commit comments

Comments
 (0)