@@ -27,7 +27,22 @@ var targetPath = fs.realpathSync(process.argv[1]);
27process.chdir(path.join(path.dirname(targetPath), ".."));
27process.chdir(path.join(path.dirname(targetPath), ".."));
29install(process.platform, process.arch).then(function() {
29install(process.platform, process.arch).then(function() {
30+ // we have to do this because the Elm binaries end in `.exe` on
31+ // Windows. Really, we should fix this upstream (in binwrap), but in the
32+ // interests of getting the installers out we're going to do this temporarily
33+ // and ship a fix upstream later.
34+ var replacement = process.argv.slice(2);
35+ if (process.platform === "win32") {
36+ replacement += ".exe";
38+ if (fs.existsSync(replacement)) {
39+ // if we replaced the bootstrap script, we should remove it. Otherwise we'd
40+ // have two of them laying around on Windows (elm and elm.exe)
41+ fs.unlinkSync(process.argv.slice(2));
30− spawn(targetPath, process.argv.slice(2), {
45+ spawn(targetPath, replacement, {
31 stdio: "inherit"
46 stdio: "inherit"
32 }).on("exit", process.exit);
47 }).on("exit", process.exit);