Skip to content

Commit

Permalink
Add placeholder purs.bin to fix npm installs (#3695)
Browse files Browse the repository at this point in the history
* Add a placeholder purs.bin file to the repo

This is necessary for successful publishing, because the npm cli will
attempt to read this file once before the postinstall script is run (at
which point it will be replaced with the actual binary).

I've also made this file produce a sensible error if you try to execute
it, which wasn't previously the case (the current one is just a text
file).

* Bump npm package to 0.13.2-pre.1

... in order to allow another npm publish attempt

* wip

* bump npm package to 0.13.2-pre.2

also copy purs.bin.placeholder to purs.bin before publish

* Remove shebang in placeholder for windows support

* Bump npm package to 0.13.2
  • Loading branch information
hdgarrood committed Jul 5, 2019
1 parent 44397e5 commit 32b0c1f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions npm-package/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "purescript",
"version": "0.13.1",
"version": "0.13.2",
"license": "ISC",
"description": "PureScript wrapper that makes it available as a local dependency",
"author": {
Expand Down Expand Up @@ -42,7 +42,8 @@
"wrapper"
],
"scripts": {
"postinstall": "install-purescript --purs-ver=0.13.1",
"prepublishOnly": "node -e \"require('fs').copyFileSync('purs.bin.placeholder', 'purs.bin');\"",
"postinstall": "install-purescript --purs-ver=0.13.2",
"test": "echo 'Error: no test specified' && exit 1"
}
}
7 changes: 7 additions & 0 deletions npm-package/purs.bin.placeholder
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This is a placeholder file of a PureScript binary installed with npm. If you
# see this file, that means the installation has failed and the placeholder has
# not been replaced with a valid binary. Try installing the `purescript` npm
# package again.

echo >&2 "purescript npm installer: installation failed; please try installing again"
exit 1

0 comments on commit 32b0c1f

Please sign in to comment.