Socket
Socket
Sign inDemoInstall

husky

Package Overview
Dependencies
Maintainers
1
Versions
214
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

husky - npm Package Compare versions

Comparing version 0.15.0-beta.13 to 0.15.0-beta.14

lib/getConf.js

5

CHANGELOG.md
# CHANGELOG
## Unreleased
## Beta
* Support `sendemail-validate` hook [#173](https://github.com/typicode/husky/pull/173)
* Support `HUSKY_SKIP_INSTALL` environment variable for skipping git hooks installation
* Drop `nvm` installed with `brew` support as it's not supported by `nvm` itself (see [creationix/nvm#important-notes](https://github.com/creationix/nvm#important-notes)), `nvm` standard installation is still supported though
* Add `.huskyrc` support [#209](https://github.com/typicode/husky/pull/209)

@@ -9,0 +8,0 @@ ## 0.14.3

0

docs.md

@@ -0,0 +0,0 @@ # Documentation

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ "use strict";

"use strict";
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -15,3 +7,3 @@ var fs = require("fs");

var pkgDir = require("pkg-dir");
var readPkg = require("read-pkg");
var getConf_1 = require("../getConf");
var getScript_1 = require("./getScript");

@@ -91,14 +83,13 @@ var is_1 = require("./is");

}
function getConf(huskyDir) {
var pkg = readPkg.sync(huskyDir);
var defaults = {
skipCI: true
};
return __assign({}, defaults, pkg.husky);
}
exports.getConf = getConf;
// export function getConf(huskyDir: string) {
// const pkg = readPkg.sync(huskyDir)
// const defaults = {
// skipCI: true
// }
// return { ...defaults, ...pkg.husky }
// }
function install(gitDir, huskyDir) {
console.log('husky > setting up git hooks');
var userDir = pkgDir.sync(path.join(huskyDir, '..'));
var conf = getConf(userDir);
var conf = getConf_1.default(userDir);
if (is_ci_1.default && conf.skipCI) {

@@ -105,0 +96,0 @@ console.log('CI detected, skipping Git hooks installation"');

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ "use strict";

@@ -5,2 +5,3 @@ "use strict";

var readPkg = require("read-pkg");
var getConf_1 = require("../getConf");
function default_1(_a, _b) {

@@ -10,3 +11,4 @@ var _c = _a[2], hookName = _c === void 0 ? '' : _c;

var pkg = readPkg.sync(cwd);
var command = pkg && pkg.husky && pkg.husky.hooks && pkg.husky.hooks[hookName];
var config = getConf_1.default(cwd);
var command = config && config.hooks && config.hooks[hookName];
var oldCommand = pkg && pkg.scripts && pkg.scripts[hookName.replace('-', '')];

@@ -22,3 +24,3 @@ try {

console.log("Warning: Setting " + hookName + " script in package.json > scripts will be deprecated in v1.0");
console.log("Please move it to husky.hooks in package.json");
console.log("Please move it to husky.hooks in package.json, a .huskyrc file, or a husky.config.js file");
console.log("Or run ./node_modules/.bin/husky-upgrade for automatic update");

@@ -25,0 +27,0 @@ console.log();

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ "use strict";

{
"name": "husky",
"version": "0.15.0-beta.13",
"version": "0.15.0-beta.14",
"description": "Prevents bad commit or push (git hooks, pre-commit/precommit, pre-push/prepush, post-merge/postmerge and all that stuff...)",

@@ -43,2 +43,3 @@ "scripts": {

"dependencies": {
"cosmiconfig": "^3.0.0",
"execa": "^0.8.0",

@@ -48,3 +49,3 @@ "is-ci": "^1.0.10",

"pupa": "^1.0.0",
"read-pkg": "^2.0.0",
"read-pkg": "^3.0.0",
"run-node": "^0.1.1",

@@ -54,11 +55,12 @@ "slash": "^1.0.0"

"devDependencies": {
"@types/jest": "^21.1.5",
"@types/node": "^8.0.47",
"@types/jest": "^21.1.8",
"@types/node": "^8.0.53",
"crlf": "^1.1.1",
"cross-env": "^5.1.0",
"cross-env": "^5.1.1",
"del": "^3.0.0",
"del-cli": "^1.1.0",
"jest": "^21.2.1",
"mkdirp": "^0.5.1",
"pkg-ok": "^1.1.0",
"prettier": "^1.7.4",
"prettier": "^1.8.2",
"tempy": "^0.2.1",

@@ -68,3 +70,3 @@ "tslint": "^5.8.0",

"tslint-plugin-prettier": "^1.3.0",
"typescript": "^2.5.3"
"typescript": "^2.6.1"
},

@@ -71,0 +73,0 @@ "jest": {

@@ -55,2 +55,4 @@ # husky [![](http://img.shields.io/npm/dm/husky.svg?style=flat)](https://www.npmjs.org/package/husky) [![npm version](https://badge.fury.io/js/husky.svg)](https://www.npmjs.com/package/husky) [![Mac/Linux Build Status](https://img.shields.io/travis/typicode/husky/master.svg?label=Mac%20OSX%20%26%20Linux)](https://travis-ci.org/typicode/husky) [![Windows Build status](https://img.shields.io/appveyor/ci/typicode/husky/master.svg?label=Windows)](https://ci.appveyor.com/project/typicode/husky/branch/master)

Alternatively, you may use any of the files/formats that are supported by [cosmiconfig](https://github.com/davidtheclark/cosmiconfig). This means that you can place your husky hooks config in a `.huskyrc` file or export them from a `husky.config.js` file as well. Cosmiconfig supports `js`, `json`, and `yaml`.
## Configure

@@ -57,0 +59,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc