Skip to content
This repository was archived by the owner on May 10, 2021. It is now read-only.

Commit 576ab36

Browse files
claudiahdzisaacs
authored andcommittedSep 24, 2019
fix: pack git directories properly
- add dirPacker to options - set dirPacker to null on lifecycle options PR-URL: #4 Credit: @claudiahdz Close: #4 Reviewed-by: @isaacs
1 parent 8c11b6d commit 576ab36

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed
 

‎index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,10 @@ class Installer {
373373
pkg, stage, pkgPath, LifecycleOpts(this.opts).concat({
374374
// TODO: can be removed once npm-lifecycle is updated to modern
375375
// config practices.
376-
config: Object.assign({}, this.opts, { log: null }),
376+
config: Object.assign({}, this.opts, {
377+
log: null,
378+
dirPacker: null
379+
}),
377380
dir: this.prefix
378381
}))
379382
).tap(() => { this.timings.scripts += Date.now() - start })

‎lib/extract.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ let workerFarm
1212
const ENABLE_WORKERS = false
1313

1414
const ExtractOpts = figgyPudding({
15-
log: {}
15+
log: {},
16+
dirPacker: {}
1617
})
1718

1819
module.exports = {

‎test/specs/lib/extract.js

+14
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,20 @@ const extract = requireInject('../../../lib/extract.js', {
1010
}
1111
})
1212

13+
test('extract.child() ensures dirPacker is defined', t => {
14+
const name = 'name'
15+
const child = { version: '0.0.0', integrity: 'integrity', resolved: 'resolved' }
16+
const childPath = './path'
17+
18+
const opts = { log: { level: 'level' }, dirPacker: {} }
19+
const a = extract.child(name, child, childPath, opts)
20+
21+
a.then(b => {
22+
t.ok('dirPacker' in b[2], 'dirPacker is defined')
23+
t.end()
24+
})
25+
})
26+
1327
test('extract.child() only overwrites dirPacker when opts.dirPacker is defined', t => {
1428
const name = 'name'
1529
const child = { version: '0.0.0', integrity: 'integrity', resolved: 'resolved' }

0 commit comments

Comments
 (0)
This repository has been archived.