Comparing version 0.0.4 to 0.0.5
@@ -8,4 +8,22 @@ #!/usr/bin/env node | ||
function hasPrefix(str, prefix) { | ||
return str.slice(0, prefix.length) === prefix; | ||
} | ||
function hasSuffix(str, suffix) { | ||
return str.slice(-suffix.length) === suffix; | ||
} | ||
function findIndex(arr, fn) { | ||
var i = 0; | ||
for (i = 0; i < arr.length; i++) { | ||
if (fn(arr[i])) { | ||
return i; | ||
} | ||
} | ||
return -1; | ||
} | ||
var platform = process.platform; | ||
if (platform.startsWith("win")) { | ||
if (hasPrefix(platform, "win")) { | ||
platform = "windows"; | ||
@@ -25,10 +43,11 @@ } | ||
var executable = path.join(__dirname, "..", "dist", platform+"-"+arch, binName); | ||
if (platform == "windows") { | ||
if (platform === "windows") { | ||
executable += ".exe"; | ||
} | ||
var argStartIndex = process.argv.findIndex(function(arg) { | ||
return arg.endsWith("storm.js") || arg.endsWith("storm"); | ||
var argStartIndex = findIndex(process.argv, function(arg) { | ||
return hasSuffix(arg, "storm.js") || hasSuffix(arg, "storm"); | ||
}); | ||
var cp = childProcess.spawn(executable, process.argv.slice(argStartIndex+1), { | ||
@@ -35,0 +54,0 @@ cwd: process.cwd(), |
{ | ||
"name": "pubstorm", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "PubStorm, the easiest way to publish your HTML5 websites and apps.", | ||
@@ -5,0 +5,0 @@ "bin": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
92826484
52