Permalink
Browse files

better platform/arch handling

  • Loading branch information...
1 parent 63667fd commit 5b50ae6adb479b0ec7f1f1f614fc26be766709a1 @igorklopov committed Apr 30, 2016
View
Oops, something went wrong.
@@ -3,7 +3,6 @@
"use strict";
// enclose ./index.js
-// enclose --x64 ./index.js
console.log(process.platform, process.arch);
console.log(process.versions);
@@ -2,10 +2,5 @@
"use strict";
-var flags = [];
-var arch = require("../../").system();
var enclose = require("../../").exec;
-var x64 = (arch === "x64");
-if (x64) flags.push("--x64");
-flags.push("./index.js");
-enclose(flags);
+enclose([ "./index.js" ]);
@@ -2,7 +2,5 @@
"use strict";
-// ./compile.js
-
console.log(process.platform, process.arch);
console.log(process.versions);
@@ -2,10 +2,5 @@
"use strict";
-var flags = [];
-var arch = require("../../").system();
var enclose = require("../../").exec;
-var x64 = (arch === "x64");
-if (x64) flags.push("--x64");
-flags.push("./index.js");
-enclose(flags);
+enclose([ "./index.js" ]);
@@ -2,7 +2,6 @@
"use strict";
-// ./compile.js
// the generated executable does
// not need submodule.js on disk.
// submodule.js is bundled inside
@@ -3,10 +3,7 @@
"use strict";
var flags = [];
-var arch = require("../../").system();
var enclose = require("../../").exec;
-var x64 = (arch === "x64");
-if (x64) flags.push("--x64");
flags.push("--loglevel", "info");
flags.push("./index.js");
enclose(flags);
@@ -2,7 +2,6 @@
"use strict";
-// ./compile.js
// the generated executable does
// not need submodule.js on disk.
// submodule.js is bundled inside
@@ -2,10 +2,5 @@
"use strict";
-var flags = [];
-var arch = require("../../").system();
var enclose = require("../../").exec;
-var x64 = (arch === "x64");
-if (x64) flags.push("--x64");
-flags.push("./index.js");
-enclose(flags);
+enclose([ "./index.js" ]);
@@ -2,8 +2,6 @@
"use strict";
-// ./compile.js
-
var port = 1337;
var http = require("http");
@@ -3,10 +3,7 @@
"use strict";
var flags = [];
-var arch = require("../../").system();
var enclose = require("../../").exec;
-var x64 = (arch === "x64");
-if (x64) flags.push("--x64");
flags.push("--config", "./config.js");
flags.push("./index.js");
enclose(flags);
@@ -2,7 +2,6 @@
"use strict";
-// ./compile.js
// the generated executable does
// not need assets directory on disk,
// it may be deployed as standalone
@@ -3,10 +3,7 @@
"use strict";
var flags = [];
-var arch = require("../../").system();
var enclose = require("../../").exec;
-var x64 = (arch === "x64");
-if (x64) flags.push("--x64");
flags.push("--config", "./config.js");
flags.push("./index.js");
enclose(flags);
@@ -2,8 +2,6 @@
"use strict";
-// ./compile.js
-
var non_literal_in_require = "./views/profile.js";
var profile = require(non_literal_in_require);
console.log(profile);
@@ -6,12 +6,9 @@
var flags = [];
var platform = process.platform;
-var arch = require("../../").system();
var enclose = require("../../").exec;
var windows = (platform === "win32");
var exe = windows ? ".exe" : "";
-var x64 = (arch === "x64");
-if (x64) flags.push("--x64");
try {
require.resolve("eslint");
@@ -6,12 +6,9 @@
var flags = [];
var platform = process.platform;
-var arch = require("../../").system();
var enclose = require("../../").exec;
var windows = (platform === "win32");
var exe = windows ? ".exe" : "";
-var x64 = (arch === "x64");
-if (x64) flags.push("--x64");
try {
require.resolve("browserify");
@@ -6,12 +6,9 @@
var flags = [];
var platform = process.platform;
-var arch = require("../../").system();
var enclose = require("../../").exec;
var windows = (platform === "win32");
var exe = windows ? ".exe" : "";
-var x64 = (arch === "x64");
-if (x64) flags.push("--x64");
try {
require.resolve("npm");
@@ -5,10 +5,7 @@
"use strict";
var flags = [];
-var arch = require("../../").system();
var enclose = require("../../").exec;
-var x64 = (arch === "x64");
-if (x64) flags.push("--x64");
try {
require.resolve("node-thrust");
@@ -5,10 +5,7 @@
"use strict";
var flags = [];
-var arch = require("../../").system();
var enclose = require("../../").exec;
-var x64 = (arch === "x64");
-if (x64) flags.push("--x64");
var modules = process.versions.modules;
if (modules) flags.push("--version", "modules" + modules);
@@ -5,10 +5,7 @@
"use strict";
var flags = [];
-var arch = require("../../").system();
var enclose = require("../../").exec;
-var x64 = (arch === "x64");
-if (x64) flags.push("--x64");
var modules = process.versions.modules;
if (modules) flags.push("--version", "modules" + modules);
@@ -41,10 +41,7 @@ if (require.main === module) {
if (error) throw error;
// sails.childProcesses[0].kill("SIGINT");
var flags = [];
- var arch = require("../../").system();
var enclose = require("../../").exec;
- var x64 = (arch === "x64");
- if (x64) flags.push("--x64");
// flags.push("--loglevel", "info");
flags.push("--config", process.argv[1]);
flags.push("./app.js");

0 comments on commit 5b50ae6

Please sign in to comment.