From 3c1b4b18055b53703e829b5cf96cf4e799f83cde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eligio=20Mari=C3=B1o?= <22875166+gmeligio@users.noreply.github.com> Date: Tue, 9 Jan 2024 19:09:38 +0100 Subject: [PATCH] fix(jsii-pacmak): show custom pack-command in timer label (#4392) Currently 'npm pack' is shown in the logs regardless of the custom command. Like in: ```log [jsii-pacmak] [INFO] Packaged. npm pack (42.4s) | cleanup (3.8s) | load jsii (0.0s) | js (0.0s) ``` This behaviour is confusing because it leaves doubt about which command was actually applied. This PR passes the value of the pack-command option to the timer label. --- By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license]. [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0 --- packages/jsii-pacmak/lib/index.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/jsii-pacmak/lib/index.ts b/packages/jsii-pacmak/lib/index.ts index 8d1115759b..cadbe05af7 100644 --- a/packages/jsii-pacmak/lib/index.ts +++ b/packages/jsii-pacmak/lib/index.ts @@ -74,11 +74,10 @@ export async function pacmak({ await updateAllNpmIgnores(modulesToPackageFlat); } - await timers.recordAsync('npm pack', () => { + const packCommand = argv['pack-command']; + await timers.recordAsync(packCommand, () => { logging.info('Packaging NPM bundles'); - return Promise.all( - modulesToPackageFlat.map((m) => m.npmPack(argv['pack-command'])), - ); + return Promise.all(modulesToPackageFlat.map((m) => m.npmPack(packCommand))); }); await timers.recordAsync('load jsii', () => {