Skip to content

Commit 1575396

Browse files
committed
fix(pack-directory): Use correct property when packing subdirectories
1 parent 2007125 commit 1575396

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

utils/pack-directory/__tests__/pack-directory.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ describe("pack-directory", () => {
194194
const last = pkgs.pop();
195195
const subs = await packDirectory(
196196
last,
197-
// TODO: use location
198-
last.contents,
197+
// a real package doesn't _actually_ need this argument
198+
undefined,
199199
conf
200200
);
201201

utils/pack-directory/lib/pack-directory.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function packDirectory(_pkg, dir, _opts) {
2424
const pkg = Package.lazy(_pkg, dir);
2525
const opts = PackConfig(_opts);
2626

27-
opts.log.verbose("pack-directory", path.relative(".", dir));
27+
opts.log.verbose("pack-directory", path.relative(".", pkg.contents));
2828

2929
let chain = Promise.resolve();
3030

@@ -42,11 +42,11 @@ function packDirectory(_pkg, dir, _opts) {
4242

4343
chain = chain.then(() => runLifecycle(pkg, "prepack", opts));
4444
chain = chain.then(() => pkg.refresh());
45-
chain = chain.then(() => packlist({ path: dir }));
45+
chain = chain.then(() => packlist({ path: pkg.contents }));
4646
chain = chain.then(files =>
4747
tar.create(
4848
{
49-
cwd: dir,
49+
cwd: pkg.contents,
5050
prefix: "package/",
5151
portable: true,
5252
// Provide a specific date in the 1980s for the benefit of zip,

0 commit comments

Comments
 (0)