simple-git-hooks
Advanced tools
Comparing version 2.7.0 to 2.8.0
#!/usr/bin/env node | ||
/** | ||
* A CLI tool to change the git hooks to commands from config | ||
*/ | ||
const {setHooksFromConfig} = require('./simple-git-hooks') | ||
@@ -4,0 +8,0 @@ |
{ | ||
"name": "simple-git-hooks", | ||
"version": "2.7.0", | ||
"version": "2.8.0", | ||
"description": "A simple, zero dependency tool for setting up git hooks for small projects", | ||
@@ -9,3 +9,2 @@ "author": "Mikhail Gorbunov <toplenboren@gmail.com> (toplenboren.github.io)", | ||
"scripts": { | ||
"publish": "clean-publish --without-publish", | ||
"postinstall": "node ./postinstall.js", | ||
@@ -12,0 +11,0 @@ "uninstall": "node ./uninstall.js" |
@@ -183,7 +183,6 @@ const fs = require('fs') | ||
function _getCustomConfigPath(argv=[]) { | ||
const cmdIdx = argv.findIndex(val => val === 'simple-git-hooks') | ||
if (cmdIdx === -1) return '' | ||
return argv[cmdIdx + 1] || '' | ||
// We'll run as one of the following: | ||
// npx simple-git-hooks ./config.js | ||
// node path/to/simple-git-hooks/cli.js ./config.js | ||
return argv[2] || '' | ||
} | ||
@@ -227,3 +226,4 @@ | ||
const {packageJsonContent} = _getPackageJson(projectRootPath) | ||
return packageJsonContent['simple-git-hooks'] | ||
const config = packageJsonContent['simple-git-hooks']; | ||
return typeof config === 'string' ? _getConfig(config) : packageJsonContent['simple-git-hooks'] | ||
} | ||
@@ -241,3 +241,5 @@ | ||
try { | ||
const filePath = path.normalize(projectRootPath + '/' + fileName) | ||
const filePath = path.isAbsolute(fileName) | ||
? fileName | ||
: path.normalize(projectRootPath + '/' + fileName) | ||
if (filePath === __filename) { | ||
@@ -244,0 +246,0 @@ return undefined |
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
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
10516
265
5
1
0