diff --git a/package.json b/package.json index 1f43bad5..4998d99d 100644 --- a/package.json +++ b/package.json @@ -32,14 +32,14 @@ }, "husky": { "hooks": { - "pre-push": "lint-staged && npm test", + "pre-commit": "lint-staged", + "pre-push": "npm test", "commit-msg": "commitlint -e $GIT_PARAMS" } }, "lint-staged": { "*.js": [ - "eslint --fix", - "git add" + "eslint --fix" ] }, "commitlint": { @@ -105,4 +105,4 @@ "path": "cz-conventional-changelog" } } -} +} \ No newline at end of file diff --git a/scripts/postinstall.js b/scripts/postinstall.js new file mode 100644 index 00000000..29cda965 --- /dev/null +++ b/scripts/postinstall.js @@ -0,0 +1,15 @@ +#!/usr/bin/env node + +function isTrue (value) { + return !!value && value !== '0' && value !== 'false' +} + +const envDisable = isTrue(process.env.DISABLE_OPENCOLLECTIVE) || isTrue(process.env.OPEN_SOURCE_CONTRIBUTOR) || isTrue(process.env.CI) +const logLevel = process.env.npm_config_loglevel +const logLevelDisplay = ['silent', 'error', 'warn'].indexOf(logLevel) > -1 + +if (!envDisable && !logLevelDisplay) { + console.log('\u001b[96m\u001b[1mThank you for using Serverless Express by Vendia!\u001b[96m\u001b[1m') + console.log('\u001b[0m\u001b[96mVendia just released their Developer Preview of Vendia Share, a service that lets you share data with partners on a distributed ledger with ease!\u001b[22m\u001b[39m') + console.log('\u001b[0m\u001b[96mSign up for the Developer Preview at https://vendia.net?ref=se \u001b[22m\u001b[39m') +}