Skip to content

Commit

Permalink
merge: master browserify
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredallard committed Jan 22, 2016
2 parents 7641afa + 53a9c5a commit 82a6e8f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Expand Up @@ -5,5 +5,5 @@ src
nexe.exe
nexe
npm-debug.log
examples/**/src
examples/**/out.nex
# test/**/src
test/**/out.nex
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -3,6 +3,8 @@
[![Join the chat at https://gitter.im/crcn/nexe](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jaredallard/nexe?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Dependency Status](https://david-dm.org/jaredallard/nexe.svg)](https://david-dm.org/crcn/nexe)
[![Stories in Ready](https://badge.waffle.io/jaredallard/nexe.svg?label=ready&title=Ready)](http://waffle.io/jaredallard/nexe)

# NOTICE: Node 5.x.x is broken right now.

Nexe is a command-line utility that compiles your Node.js application into a single executable file.

![screen shot 2014-02-28 at 10 32 54 am](https://f.cloud.github.com/assets/757408/2296993/c276f7b6-a0a6-11e3-86d3-e6c5feba2a85.png)
Expand Down
4 changes: 1 addition & 3 deletions lib/bundle.js
Expand Up @@ -22,6 +22,7 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**/

var mdeps = require("module-deps"),
path = require("path"),
spawn = require('child_process').spawn,
Expand Down Expand Up @@ -84,6 +85,3 @@ function bundle (input, nc, complete) {
complete();
});
});
}

module.exports = bundle;
15 changes: 11 additions & 4 deletions lib/exe.js
Expand Up @@ -277,13 +277,12 @@ exports.compile = function (options, complete) {
*/

function _downloadNode(version, directory, nodeConfigureArgs, nodeMakeArgs, complete) {

var nodeFileDir = path.resolve(path.join(directory, framework, version)), // fixes #107, was process.cwd(), + rest.
nodeFilePath = path.resolve(path.join(nodeFileDir, framework + "-" + version + ".tar.gz"));


// might already be downloaded, and unzipped
if (_getNodeCompiler(nodeFileDir, complete)) {
if (_getNodeCompiler(nodeFileDir, nodeConfigureArgs, nodeMakeArgs, complete)) {
return;
}

Expand Down Expand Up @@ -547,7 +546,13 @@ function _monkeyPatchMainJs (compiler, complete) {
return ~content.indexOf("nexe");
},
function (content, next) {
next(null, content.replace(/\(function\(process\) \{/,'(function(process) {\n process._eval = \'require("nexe");\';\n process.argv.splice(1, 0, "nexe.js");\n'))
next(null, content.replace(/\(function\(process\) \{/,'\
(function(process) {\n\
process._eval = \'require("nexe");\';\n\
if (process.argv[1] !== "nexe.js") {\n\
process.argv.splice(1, 0, "nexe.js");\n\
}\n\
'))
},
complete
);
Expand All @@ -564,7 +569,7 @@ function _monkeyPatchChildProcess(compiler, complete) {
return ~content.indexOf("--child_process");
},
function (content, next) {
next(null, content.replace(/return spawn\(/, 'args.unshift("--child_process");\n return spawn('));
next(null, content.replace(/return spawn\(/, 'args.unshift("nexe.js", "--child_process");\n return spawn('));
},
complete
);
Expand Down Expand Up @@ -684,6 +689,8 @@ exports.package = function(path, options) {
input: (_package.nexe.input || options.i),
output: (_package.nexe.output || options.o),
flags: (_package.nexe.runtime.ignoreFlags || options.f),
nodeConfigureArgs: (_package.nexe.runtime.nodeConfigureArgs || []),
nodeMakeArgs: (_package.nexe.runtime.nodeMakeArgs || []),
resourceFiles: (_package.nexe.resourceFiles),
nodeVersion: (_package.nexe.runtime.version || options.r),
nodeConfigureArgs: (_package.nexe.runtime.nodeConfigureArgs || []),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -45,7 +45,7 @@
"ignoreFlags": true
}
},
"preferGlobal": "true",
"preferGlobal": true,
"bin": {
"nexe": "./bin/nexe"
},
Expand Down

0 comments on commit 82a6e8f

Please sign in to comment.