husky.js 560 B

12345678910111213141516171819202122232425
  1. /* eslint-disable */
  2. // @ts-ignore
  3. const pleaseUpgradeNode = require('please-upgrade-node')
  4. const pkg = require('./package.json')
  5. // Node version isn't supported, skip install
  6. pleaseUpgradeNode(pkg, {
  7. exitCode: 0,
  8. message: function(requiredVersion) {
  9. return (
  10. 'Husky requires Node ' +
  11. requiredVersion +
  12. ' (runtime: ' + process.version + ')' +
  13. ', skipping Git hooks installation.'
  14. )
  15. }
  16. })
  17. // Node version is supported, continue
  18. try {
  19. require('./lib/installer/bin')
  20. } catch (e) {
  21. console.log('missing lib directory')
  22. }