Skip to content

Commit

Permalink
fixup! feat(pack): add pack-destination config
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar committed Jun 17, 2021
1 parent 1d94c28 commit 55435db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class Pack extends BaseCommand {
for (const { arg, filename, manifest } of manifests) {
const tarballData = await libpack(arg, this.npm.flatOptions)
const pkgContents = await getContents(manifest, tarballData)
const tarballFilename = path.join(this.npm.config.get('pack-destination'), filename)
const tarballFilename = path.resolve(this.npm.config.get('pack-destination'), filename)

if (!dryRun)
await writeFile(tarballFilename, tarballData)
Expand Down
4 changes: 2 additions & 2 deletions test/lib/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ t.test('should pack current directory with no arguments', (t) => {

const filename = `npm-${require('../../package.json').version}.tgz`
t.strictSame(OUTPUT, [[filename]])
t.strictSame(tarballFileName, filename)
t.strictSame(tarballFileName, path.resolve(filename))
t.end()
})
})
Expand Down Expand Up @@ -87,7 +87,7 @@ t.test('follows pack-destination config', (t) => {

const filename = `npm-${require('../../package.json').version}.tgz`
t.strictSame(OUTPUT, [[filename]])
t.strictSame(tarballFileName, path.join('/tmp/test', filename))
t.strictSame(tarballFileName, path.resolve('/tmp/test', filename))
t.end()
})
})
Expand Down

0 comments on commit 55435db

Please sign in to comment.