diff --git a/utils/pack-directory/__tests__/pack-directory.test.js b/utils/pack-directory/__tests__/pack-directory.test.js index dd31b84b5e..62cbe0edec 100644 --- a/utils/pack-directory/__tests__/pack-directory.test.js +++ b/utils/pack-directory/__tests__/pack-directory.test.js @@ -194,8 +194,8 @@ describe("pack-directory", () => { const last = pkgs.pop(); const subs = await packDirectory( last, - // TODO: use location - last.contents, + // a real package doesn't _actually_ need this argument + undefined, conf ); diff --git a/utils/pack-directory/lib/pack-directory.js b/utils/pack-directory/lib/pack-directory.js index e43a1a1a1e..d46069c783 100644 --- a/utils/pack-directory/lib/pack-directory.js +++ b/utils/pack-directory/lib/pack-directory.js @@ -24,7 +24,7 @@ function packDirectory(_pkg, dir, _opts) { const pkg = Package.lazy(_pkg, dir); const opts = PackConfig(_opts); - opts.log.verbose("pack-directory", path.relative(".", dir)); + opts.log.verbose("pack-directory", path.relative(".", pkg.contents)); let chain = Promise.resolve(); @@ -42,11 +42,11 @@ function packDirectory(_pkg, dir, _opts) { chain = chain.then(() => runLifecycle(pkg, "prepack", opts)); chain = chain.then(() => pkg.refresh()); - chain = chain.then(() => packlist({ path: dir })); + chain = chain.then(() => packlist({ path: pkg.contents })); chain = chain.then(files => tar.create( { - cwd: dir, + cwd: pkg.contents, prefix: "package/", portable: true, // Provide a specific date in the 1980s for the benefit of zip,