Skip to content
This repository was archived by the owner on Aug 23, 2018. It is now read-only.

Commit 458b2f3

Browse files
author
Richard Feldman
authored
use GitHub Releases over Bintray, add --ignore-scripts compatibility (#233)
* move binaries/ to bin/ * Require node>=5.2.0 for npx * Use binwrap over binstall * Make default binaries friendly to --ignore-scripts * Specify main in package.json * fixup! Make default binaries friendly to --ignore-scripts * Bump version to 0.18.0-exp * chmod +x bin/* * Fix packageInfo * Add bin/ contents to files * Bump to exp3 * Add bin/ to files * Bump to exp4 for release
1 parent c83832c commit 458b2f3

File tree

13 files changed

+213
-50
lines changed

13 files changed

+213
-50
lines changed

installers/npm/bin/elm

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env node
2+
3+
// This file exists for the benefit of npm users who have --ignore-scripts
4+
// enabled. (Enabling this flag globally is a good security measure.)
5+
// Since they won't run the post-install hook, the binaries won't be downloaded
6+
// and installed.
7+
//
8+
// Since this file is included in "bin" in package.json, npm will install
9+
// it automatically in a place that should be on the PATH. All the file does
10+
// is to download the appropriate binary (just like the post-install hook would
11+
// have), replace this file with that binary, and run the binary.
12+
//
13+
// In this way, the first time a user with --ignore-scripts enabled runs this
14+
// binary, it will download and install itself, and then run as normal. From
15+
// then on, it will run as normal without re-downloading.
16+
17+
var install = require("..").install;
18+
var spawn = require("child_process").spawn;
19+
var path = require("path");
20+
var fs = require("fs");
21+
22+
// Make sure we get the right path even if we're executing from the symlinked
23+
// node_modules/.bin/ executable
24+
var targetPath = fs.realpathSync(process.argv[1]);
25+
26+
console.log("Finishing setup for first run...\n");
27+
28+
// cd into the directory above bin/ so install() puts bin/ in the right place.
29+
process.chdir(path.join(path.dirname(targetPath), ".."));
30+
31+
install(process.platform, process.arch).then(function() {
32+
spawn(targetPath, process.argv.slice(2), {
33+
stdio: "inherit"
34+
}).on("exit", process.exit);
35+
});

installers/npm/bin/elm-make

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env node
2+
3+
// This file exists for the benefit of npm users who have --ignore-scripts
4+
// enabled. (Enabling this flag globally is a good security measure.)
5+
// Since they won't run the post-install hook, the binaries won't be downloaded
6+
// and installed.
7+
//
8+
// Since this file is included in "bin" in package.json, npm will install
9+
// it automatically in a place that should be on the PATH. All the file does
10+
// is to download the appropriate binary (just like the post-install hook would
11+
// have), replace this file with that binary, and run the binary.
12+
//
13+
// In this way, the first time a user with --ignore-scripts enabled runs this
14+
// binary, it will download and install itself, and then run as normal. From
15+
// then on, it will run as normal without re-downloading.
16+
17+
var install = require("..").install;
18+
var spawn = require("child_process").spawn;
19+
var path = require("path");
20+
var fs = require("fs");
21+
22+
// Make sure we get the right path even if we're executing from the symlinked
23+
// node_modules/.bin/ executable
24+
var targetPath = fs.realpathSync(process.argv[1]);
25+
26+
console.log("Finishing setup for first run...\n");
27+
28+
// cd into the directory above bin/ so install() puts bin/ in the right place.
29+
process.chdir(path.join(path.dirname(targetPath), ".."));
30+
31+
install(process.platform, process.arch).then(function() {
32+
spawn(targetPath, process.argv.slice(2), {
33+
stdio: "inherit"
34+
}).on("exit", process.exit);
35+
});

installers/npm/bin/elm-package

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env node
2+
3+
// This file exists for the benefit of npm users who have --ignore-scripts
4+
// enabled. (Enabling this flag globally is a good security measure.)
5+
// Since they won't run the post-install hook, the binaries won't be downloaded
6+
// and installed.
7+
//
8+
// Since this file is included in "bin" in package.json, npm will install
9+
// it automatically in a place that should be on the PATH. All the file does
10+
// is to download the appropriate binary (just like the post-install hook would
11+
// have), replace this file with that binary, and run the binary.
12+
//
13+
// In this way, the first time a user with --ignore-scripts enabled runs this
14+
// binary, it will download and install itself, and then run as normal. From
15+
// then on, it will run as normal without re-downloading.
16+
17+
var install = require("..").install;
18+
var spawn = require("child_process").spawn;
19+
var path = require("path");
20+
var fs = require("fs");
21+
22+
// Make sure we get the right path even if we're executing from the symlinked
23+
// node_modules/.bin/ executable
24+
var targetPath = fs.realpathSync(process.argv[1]);
25+
26+
console.log("Finishing setup for first run...\n");
27+
28+
// cd into the directory above bin/ so install() puts bin/ in the right place.
29+
process.chdir(path.join(path.dirname(targetPath), ".."));
30+
31+
install(process.platform, process.arch).then(function() {
32+
spawn(targetPath, process.argv.slice(2), {
33+
stdio: "inherit"
34+
}).on("exit", process.exit);
35+
});

installers/npm/bin/elm-reactor

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env node
2+
3+
// This file exists for the benefit of npm users who have --ignore-scripts
4+
// enabled. (Enabling this flag globally is a good security measure.)
5+
// Since they won't run the post-install hook, the binaries won't be downloaded
6+
// and installed.
7+
//
8+
// Since this file is included in "bin" in package.json, npm will install
9+
// it automatically in a place that should be on the PATH. All the file does
10+
// is to download the appropriate binary (just like the post-install hook would
11+
// have), replace this file with that binary, and run the binary.
12+
//
13+
// In this way, the first time a user with --ignore-scripts enabled runs this
14+
// binary, it will download and install itself, and then run as normal. From
15+
// then on, it will run as normal without re-downloading.
16+
17+
var install = require("..").install;
18+
var spawn = require("child_process").spawn;
19+
var path = require("path");
20+
var fs = require("fs");
21+
22+
// Make sure we get the right path even if we're executing from the symlinked
23+
// node_modules/.bin/ executable
24+
var targetPath = fs.realpathSync(process.argv[1]);
25+
26+
console.log("Finishing setup for first run...\n");
27+
28+
// cd into the directory above bin/ so install() puts bin/ in the right place.
29+
process.chdir(path.join(path.dirname(targetPath), ".."));
30+
31+
install(process.platform, process.arch).then(function() {
32+
spawn(targetPath, process.argv.slice(2), {
33+
stdio: "inherit"
34+
}).on("exit", process.exit);
35+
});

installers/npm/bin/elm-repl

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env node
2+
3+
// This file exists for the benefit of npm users who have --ignore-scripts
4+
// enabled. (Enabling this flag globally is a good security measure.)
5+
// Since they won't run the post-install hook, the binaries won't be downloaded
6+
// and installed.
7+
//
8+
// Since this file is included in "bin" in package.json, npm will install
9+
// it automatically in a place that should be on the PATH. All the file does
10+
// is to download the appropriate binary (just like the post-install hook would
11+
// have), replace this file with that binary, and run the binary.
12+
//
13+
// In this way, the first time a user with --ignore-scripts enabled runs this
14+
// binary, it will download and install itself, and then run as normal. From
15+
// then on, it will run as normal without re-downloading.
16+
17+
var install = require("..").install;
18+
var spawn = require("child_process").spawn;
19+
var path = require("path");
20+
var fs = require("fs");
21+
22+
// Make sure we get the right path even if we're executing from the symlinked
23+
// node_modules/.bin/ executable
24+
var targetPath = fs.realpathSync(process.argv[1]);
25+
26+
console.log("Finishing setup for first run...\n");
27+
28+
// cd into the directory above bin/ so install() puts bin/ in the right place.
29+
process.chdir(path.join(path.dirname(targetPath), ".."));
30+
31+
install(process.platform, process.arch).then(function() {
32+
spawn(targetPath, process.argv.slice(2), {
33+
stdio: "inherit"
34+
}).on("exit", process.exit);
35+
});

installers/npm/binaries/elm

Lines changed: 0 additions & 1 deletion
This file was deleted.

installers/npm/binaries/elm-make

Lines changed: 0 additions & 1 deletion
This file was deleted.

installers/npm/binaries/elm-package

Lines changed: 0 additions & 1 deletion
This file was deleted.

installers/npm/binaries/elm-reactor

Lines changed: 0 additions & 1 deletion
This file was deleted.

installers/npm/binaries/elm-repl

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)