Comparing version 5.1.0 to 5.1.1
@@ -20,3 +20,3 @@ "use strict"; | ||
} | ||
const data = ['#!/bin/sh', '. "$(dirname "$0")/_/husky.sh"', '', cmd].join('\n'); | ||
const data = ['#!/bin/sh', '. "$(dirname "$0")/_/husky.sh"', '', cmd, ''].join('\n'); | ||
fs_1.default.writeFileSync(file, data, 'utf-8'); | ||
@@ -23,0 +23,0 @@ console.log(`husky - created ${dir}${path_1.default.sep}${path_1.default.basename(file)}`); |
@@ -10,7 +10,11 @@ "use strict"; | ||
const install_1 = require("./install"); | ||
const regex = /^[ ]+|\t+/m; | ||
function init() { | ||
const pkg = JSON.parse(fs_1.default.readFileSync('package.json', 'utf-8')); | ||
if (pkg.scripts !== undefined) { | ||
pkg.scripts.postinstall = 'husky install'; | ||
} | ||
var _a; | ||
const str = fs_1.default.readFileSync('package.json', 'utf-8'); | ||
const pkg = JSON.parse(str); | ||
pkg.scripts || (pkg.scripts = {}); | ||
pkg.scripts.postinstall = 'husky install'; | ||
const indent = (_a = regex.exec(str)) === null || _a === void 0 ? void 0 : _a[0]; | ||
fs_1.default.writeFileSync('package.json', JSON.stringify(pkg, null, indent)); | ||
install_1.install(); | ||
@@ -17,0 +21,0 @@ add_1.add('.husky/pre-commit', 'npm test'); |
@@ -24,3 +24,3 @@ "use strict"; | ||
fs_1.default.mkdirSync(path_1.default.join(dir, '_'), { recursive: true }); | ||
fs_1.default.writeFileSync(path_1.default.join(dir, '.gitignore'), '_', 'utf-8'); | ||
fs_1.default.writeFileSync(path_1.default.join(dir, '.gitignore'), '_\n', 'utf-8'); | ||
fs_1.default.copyFileSync(path_1.default.join(__dirname, '../../scripts/husky.sh'), path_1.default.join(dir, '_/husky.sh')); | ||
@@ -27,0 +27,0 @@ const { error } = child_process_1.default.spawnSync('git', ['config', 'core.hooksPath', dir]); |
{ | ||
"name": "husky", | ||
"version": "5.1.0", | ||
"version": "5.1.1", | ||
"description": "Git hooks made easy", | ||
@@ -44,3 +44,3 @@ "bin": { | ||
"preversion": "npm run build", | ||
"postversion": "git push && git push --tags && npm publish --tag next", | ||
"postversion": "git push && git push --tags && npm publish", | ||
"prepublishOnly": "pinst --disable", | ||
@@ -47,0 +47,0 @@ "postpublish": "pinst --enable", |
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
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
25707
176