on master help sign in
Merge pull request #1754 from BrianHicks/nineteen-rc2
f3d223bEvan Czaplicki
installers/npm/bin/elm+20−5
@@ -15,19 +15,34 @@
15// then on, it will run as normal without re-downloading.
15// then on, it will run as normal without re-downloading.
16
16
17var install = require("..").install;
17var install = require("..").install;
18−var spawn = require("child_process").spawn;
18+var child_process = require("child_process");
19var path = require("path");
19var path = require("path");
20var fs = require("fs");
20var fs = require("fs");
21
21
22// Make sure we get the right path even if we're executing from the symlinked
22// Make sure we get the right path even if we're executing from the symlinked
23// node_modules/.bin/ executable
23// node_modules/.bin/ executable
24+var interpreter = fs.realpathSync(process.argv[0]);
24var targetPath = fs.realpathSync(process.argv[1]);
25var targetPath = fs.realpathSync(process.argv[1]);
25
26
27+// Figure out the binary name as we'll eventually want to execute
28+// this. Re-executing this script doesn't always work because of varying
29+// permissions and modes of operation across platforms (for example, Windows has
30+// some interesting edge cases here.)
31+var binaryName = path.join(
32+ __dirname,
33+ "..",
34+ "unpacked_bin",
35+ path.basename(targetPath)
36+);
37+if (process.platform === "win") {
38+ binaryName += ".exe";
39+}
40+
26// cd into the directory above bin/ so install() puts bin/ in the right place.
41// cd into the directory above bin/ so install() puts bin/ in the right place.
27process.chdir(path.join(path.dirname(targetPath), ".."));
42process.chdir(path.join(path.dirname(targetPath), ".."));
28
43
29install(process.platform, process.arch).then(function() {
44install(process.platform, process.arch).then(function() {
45+ child_process
30− spawn(targetPath, process.argv.slice(2), {
46+ .spawn(binaryName, process.argv.slice(2), { stdio: "inherit" })
31− stdio: "inherit"
32− }).on("exit", process.exit);
47+ .on("exit", process.exit);
33−});
48+});
installers/npm/package.json+1−1
@@ -1,6 +1,6 @@
1{
1{
2 "name": "elm",
2 "name": "elm",
3− "version": "0.19.0",
3+ "version": "0.19.0-bugfix2",
4 "description": "The Elm Platform: Binaries for the Elm programming language.",
4 "description": "The Elm Platform: Binaries for the Elm programming language.",
5 "main": "index.js",
5 "main": "index.js",
6 "preferGlobal": true,
6 "preferGlobal": true,