exe: fix an issue where finalContents isnt initialized, more test work

This commit is contained in:
Jared Allard
2016-02-24 12:58:13 -08:00
parent 208c2b2b56
commit ab1d92cf68
10 changed files with 35 additions and 23 deletions
+1
View File
@@ -6,6 +6,7 @@ test/**/test.nex
test/**/tmp
test/**/node_modules
test/**/*.map
test/src
src
.idea
+14 -13
View File
@@ -700,17 +700,19 @@ function _monkeyPatchChildProcess(compiler, complete) {
*/
function _monkeyPatchMainCc(compiler, complete) {
var mainPath = path.join(compiler.dir, "src", "node.cc");
var mainC = fs.readFileSync(mainPath, {
let finalContents;
let mainPath = path.join(compiler.dir, "src", "node.cc");
let mainC = fs.readFileSync(mainPath, {
encoding: 'utf8'
});
// content split, and original start/end
var constant_loc = 1;
var lines = mainC.split('\n');
var startLine = lines.indexOf(' // TODO use parse opts');
var endLine = lines.indexOf(' option_end_index = i;'); // pre node 0.11.6 compat
var isPatched = lines.indexOf('// NEXE_PATCH_IGNOREFLAGS');
let constant_loc = 1;
let lines = mainC.split('\n');
let startLine = lines.indexOf(' // TODO use parse opts');
let endLine = lines.indexOf(' option_end_index = i;'); // pre node 0.11.6 compat
let isPatched = lines.indexOf('// NEXE_PATCH_IGNOREFLAGS');
if (isPatched !== -1) {
_log('already patched node.cc');
@@ -955,6 +957,11 @@ exports.package = function(path, options) {
_package = require(path);
}
if(!_package || !_package.nexe) {
_log('error', 'trying to use package.json variables, but not setup to do so!');
process.exit(1);
}
// replace ^$ w/ os specific extension on output
if (isWin) {
_package.nexe.output = _package.nexe.output.replace(/\^\$/, '.exe') // exe
@@ -992,12 +999,6 @@ exports.package = function(path, options) {
_log("log", v + " => '" + _package.nexe[v] + "'");
}
});
Object.keys(_package.nexe.runtime).forEach(function(v, i) {
_log("log", "runtime." + v + " => '" + _package.nexe.runtime[v] + "'");
});
Object.keys(_package.nexe.browserify).forEach(function(v, i) {
_log("log", "browserify." + v + " => '" + _package.nexe.browserify[v] + "'");
});
return obj;
}
+1 -1
View File
@@ -21,7 +21,7 @@
"debug": false,
"runtime": {
"framework": "node",
"version": "5.5.0"
"version": "5.7.0"
}
}
}
+1 -2
View File
@@ -1,5 +1,4 @@
#!/usr/bin/env node
require('source-map-support').install();
/**
* Module dependencies.
@@ -90,4 +89,4 @@ function onListening() {
debug('Listening on ' + bind);
}
console.log(true);
process.stdout.write(true);
+3 -3
View File
@@ -17,11 +17,11 @@
"nexe": {
"input": "bin/www",
"output": "test.nex",
"temp": "src",
"debug": true,
"temp": "../src",
"debug": false,
"runtime": {
"framework": "node",
"version": "5.5.0",
"version": "5.7.0",
"ignoreFlags": true
}
}
+1 -1
View File
@@ -10,4 +10,4 @@
let isStrict = (function() { return !this; })();
console.log('test:strict-mode:status =', isStrict);
console.log(isStrict);
+1 -1
View File
@@ -6,7 +6,7 @@
"temp": "../src",
"runtime": {
"framework": "node",
"version": "0.10.0",
"version": "5.7.0",
"ignoreFlags": false,
"js-flags": "--use_strict",
"node-args": ""
+11
View File
@@ -11,5 +11,16 @@
"dependencies": {
"gulp": "^3.9.0",
"nexe": "^1.0.5"
},
"nexe": {
"input": "./index.js",
"output": "test.nex",
"temp": "../src",
"runtime": {
"framework": "node",
"version": "5.7.0",
"ignoreFlags": true,
"node-args": ""
}
}
}
+1 -1
View File
@@ -6,7 +6,7 @@
"temp": "../src",
"runtime": {
"framework": "node",
"version": "5.5.0",
"version": "5.7.0",
"ignoreFlags": true,
"node-args": ""
}
+1 -1
View File
@@ -16,7 +16,7 @@
"output": "test.nex",
"temp": "../src",
"runtime": {
"version": "5.5.0",
"version": "5.7.0",
"framework": "node"
}
}