Skip to content

Commit

Permalink
fix(pacmak): fails when package path contains space (#2758)
Browse files Browse the repository at this point in the history
Quoting the package path in the sub-shell command so that spaces are not
incorrectly interpreted as argument delimiters.

Fixes #2748
  • Loading branch information
RomainMuller authored May 27, 2021
1 parent 82f5d5f commit 0fbba6b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/jsii-pacmak/lib/packaging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down

0 comments on commit 0fbba6b

Please sign in to comment.