From 1575396723b053640a2b15d35c493525a52540f1 Mon Sep 17 00:00:00 2001 From: Daniel Stockman Date: Tue, 23 Jul 2019 15:07:57 -0700 Subject: [PATCH] fix(pack-directory): Use correct property when packing subdirectories --- utils/pack-directory/__tests__/pack-directory.test.js | 4 ++-- utils/pack-directory/lib/pack-directory.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) 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,