diff --git a/lib/index.js b/lib/index.js index 9cc3d4189..09ed139ae 100644 --- a/lib/index.js +++ b/lib/index.js @@ -718,7 +718,8 @@ NwBuilder.prototype.runApp = function () { self.emit('log', 'Launching App'); return new Promise(function(resolve, reject) { - var nwProcess = self._nwProcess = spawn(executable, ['--enable-logging', self.options.files.replace(/\*[\/\*]*/,"")].concat(self.options.argv)); + var parentDirectory = (_.isArray(self.options.files) ? self.options.files[0] : self.options.files ).replace(/\*[\/\*]*/,""); + var nwProcess = self._nwProcess = spawn(executable, ['--enable-logging', parentDirectory].concat(self.options.argv)); self.emit('appstart');