Skip to content

Commit

Permalink
fix(install): fail gracefully on occasional npm@2.15 hickups (#109)
Browse files Browse the repository at this point in the history
* fix(install): fail gracefully on occasional npm@2.15 hickups

* docs(install): use `npm explore` to rerun install script

... as well as mention the original issue on GitHub.
  • Loading branch information
ta2edchimp authored and Kent C. Dodds committed Jun 16, 2016
1 parent 817f3dc commit 3ea9139
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions bin/module-install
@@ -0,0 +1,16 @@
#!/usr/bin/env node
try {
const opt = require('opt-cli')
if (!opt.testOptOut('ghooks-install')) {
require('./install')
}
} catch (e) {
console.warn( // eslint-disable-line no-console
'\nghooks postinstall could not be completed.\n' +
'==========================================\n\n' +
'Usually this is due to using npm@2.15.x. Please consider updating npm\n' +
'to its latest version or run the following command manually afterwards:\n\n' +
'\tnpm explore ghooks -- npm run install\n\n' +
'See https://github.com/gtramontina/ghooks/issues/71 for more information.\n'
)
}
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -29,7 +29,7 @@
"report-coverage": "cat ./coverage/lcov.info | node_modules/.bin/codecov",
"validate": "npm t && npm run check-coverage",
"commit": "git-cz",
"install": "opt --out ghooks-install --exec \"node ./bin/install\"",
"install": "node ./bin/module-install",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
},
"dependencies": {
Expand Down

0 comments on commit 3ea9139

Please sign in to comment.