Comparing version 7.0.4 to 8.0.3
@@ -28,4 +28,4 @@ #!/usr/bin/env node | ||
catch (e) { | ||
console.error(e.message); | ||
console.error(e instanceof Error ? `husky - ${e.message}` : e); | ||
process.exit(1); | ||
} |
@@ -10,6 +10,11 @@ "use strict"; | ||
function install(dir = '.husky') { | ||
if (process.env.HUSKY === '0') { | ||
l('HUSKY env variable is set to 0, skipping install'); | ||
return; | ||
} | ||
if (git(['rev-parse']).status !== 0) { | ||
l(`git command not found, skipping install`); | ||
return; | ||
} | ||
const url = 'https://git.io/Jc3F9'; | ||
const url = 'https://typicode.github.io/husky/#/?id=custom-directory'; | ||
if (!p.resolve(process.cwd(), dir).startsWith(process.cwd())) { | ||
@@ -42,4 +47,4 @@ throw new Error(`.. not allowed (see ${url})`); | ||
} | ||
fs.writeFileSync(file, `#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
fs.writeFileSync(file, `#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
@@ -46,0 +51,0 @@ ${cmd} |
{ | ||
"name": "husky", | ||
"version": "7.0.4", | ||
"version": "8.0.3", | ||
"description": "Modern native Git hooks made easy", | ||
@@ -29,13 +29,13 @@ "keywords": [ | ||
"devDependencies": { | ||
"@commitlint/cli": "^12.0.1", | ||
"@commitlint/config-conventional": "^12.0.1", | ||
"@tsconfig/node12": "^1.0.7", | ||
"@types/node": "^15.3.1", | ||
"@typicode/eslint-config": "^0.1.2", | ||
"docsify-cli": "^4.4.3", | ||
"typescript": "^4.2.3" | ||
"@commitlint/cli": "^17.3.0", | ||
"@commitlint/config-conventional": "^17.3.0", | ||
"@tsconfig/node14": "^1.0.3", | ||
"@types/node": "^18.11.18", | ||
"@typicode/eslint-config": "^1.1.0", | ||
"docsify-cli": "^4.4.4", | ||
"typescript": "^4.9.4" | ||
}, | ||
"engines": { | ||
"node": ">=12" | ||
"node": ">=14" | ||
} | ||
} |
@@ -18,3 +18,3 @@ # husky | ||
```sh | ||
npm set-script prepare "husky install" | ||
npm pkg set scripts.prepare="husky install" | ||
npm run prepare | ||
@@ -21,0 +21,0 @@ ``` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6442
102
4