From 23f550818bba51253f3120a5301d3c27e67de5f3 Mon Sep 17 00:00:00 2001 From: Ishai Jaffe Date: Mon, 13 Nov 2017 14:30:59 +0200 Subject: [PATCH] fix(shim): properly serialize path --- package.json | 2 +- src/steps/shim.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index f0af579..26a9c23 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "nexe", "description": "Create a single executable out of your Node.js application", "license": "MIT", - "version": "2.0.0-rc.19", + "version": "2.0.0-rc.20", "contributors": [ "Craig Condon (http://crcn.io)", "Jared Allard ", diff --git a/src/steps/shim.ts b/src/steps/shim.ts index 99f480a..6063cbd 100644 --- a/src/steps/shim.ts +++ b/src/steps/shim.ts @@ -25,11 +25,11 @@ export default function(compiler: NexeCompiler, next: () => Promise) { if (compiler.options.fakeArgv !== false) { const nty = !process.stdin.isTTY - const input = nty ? '[stdin]' : compiler.options.input + const input = nty ? '[stdin]' : JSON.stringify(compiler.options.input) compiler.shims.push( wrap(` var r = require('path').resolve; - process.argv.splice(1,0, ${nty ? `'${input}'` : `r("${input}")`});`) + process.argv.splice(1,0, ${nty ? `'${input}'` : `r(${input})`});`) ) }