From 7430a78dd12dc6257dea86ddd267c3488c020031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=91=A8=F0=9F=8F=BB=E2=80=8D=F0=9F=92=BB=20Romain=20M?= =?UTF-8?q?arcadier?= Date: Tue, 30 Mar 2021 13:06:23 +0200 Subject: [PATCH] fix(pacmak): fails when package path contains space Quoting the package path in the sub-shell command so that spaces are not incorrectly interpreted as argument delimiters. Fixes #2748 --- packages/jsii-pacmak/lib/packaging.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/jsii-pacmak/lib/packaging.ts b/packages/jsii-pacmak/lib/packaging.ts index 162ba2c03c..31ceed9c18 100644 --- a/packages/jsii-pacmak/lib/packaging.ts +++ b/packages/jsii-pacmak/lib/packaging.ts @@ -55,7 +55,9 @@ export class JsiiModule { public async npmPack() { this._tarball = await Scratch.make(async (tmpdir) => { logging.debug(`Running "npm pack ${this.moduleDirectory}" in ${tmpdir}`); - const args = ['pack', this.moduleDirectory]; + // Quoting (JSON-stringifying) the module directory in order to avoid + // problems if there are spaces or other special characters in the path. + const args = ['pack', JSON.stringify(this.moduleDirectory)]; if (logging.level >= logging.LEVEL_VERBOSE) { args.push('--loglevel=verbose'); }