Comparing version 0.2.2 to 0.2.4
@@ -6,3 +6,3 @@ module.exports = installHooks; | ||
var resolve = require('path').resolve; | ||
var projectRoot = resolve(cwd.replace(/node_modules\/.*/, '')); | ||
var projectRoot = resolve(cwd.replace(/node_modules\/.*|node_modules\\.*/, '')); | ||
var hooksDir = resolve(projectRoot, '.git/hooks'); | ||
@@ -9,0 +9,0 @@ var template = require('./hook.template'); |
{ | ||
"name" : "ghooks", | ||
"description" : "Simple git hooks", | ||
"version" : "0.2.2", | ||
"version" : "0.2.4", | ||
"main" : "./lib/runner.js", | ||
@@ -22,3 +22,3 @@ "keywords" : [ "git", "hooks", "hook" ], | ||
"test" : "make test", | ||
"install" : "./bin/install" | ||
"install" : "node ./bin/install" | ||
}, | ||
@@ -31,12 +31,12 @@ | ||
"devDependencies" : { | ||
"mocha" : "^1.18.2", | ||
"chai" : "^1.9.1", | ||
"sinon" : "^1.9.1", | ||
"sinon-chai" : "^2.5.0", | ||
"proxyquire" : "^1.0.1", | ||
"mock-fs" : "^2.2.0", | ||
"mocha-cov-reporter" : "^1.1.0", | ||
"mocha" : "^2.0.1", | ||
"chai" : "^1.10.0", | ||
"sinon" : "^1.12.1", | ||
"sinon-chai" : "^2.6.0", | ||
"proxyquire" : "^1.1.0", | ||
"mock-fs" : "^2.3.2", | ||
"mocha-cov-reporter" : "^1.1.1", | ||
"blanket" : "^1.1.6", | ||
"jshint-stylish" : "^1.0.0", | ||
"jshint" : "^2.5.0", | ||
"jshint" : "^2.5.10", | ||
"ghooks" : "*" | ||
@@ -43,0 +43,0 @@ }, |
@@ -7,9 +7,8 @@ require('./setup')(); | ||
it('warns when the target is not a git project', function () { | ||
it('warns when the target is not a git project', sinon.test(function () { | ||
fsStub({}); | ||
console.warn = function (message) { | ||
expect(message).to.match(/this does not seem to be a git project/i); | ||
}; | ||
var warn = this.stub(console, 'warn'); | ||
install(); | ||
}); | ||
expect(warn).to.have.been.calledWithMatch(/this does not seem to be a git project/i); | ||
})); | ||
@@ -16,0 +15,0 @@ it('creates hooks directory', function () { |
@@ -5,7 +5,8 @@ var chai = require('chai'); | ||
global.expect = chai.expect; | ||
global.stub = require('sinon').stub; | ||
global.spy = require('sinon').spy; | ||
global.sinon = require('sinon'); | ||
global.stub = sinon.stub; | ||
global.spy = sinon.spy; | ||
global.fsStub = require('mock-fs'); | ||
global.fs = require('fs'); | ||
global.proxyquire = require('proxyquire'); | ||
global.proxyquire = require('proxyquire').noCallThru(); | ||
@@ -12,0 +13,0 @@ global.fileContent = function (file) { |
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
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
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
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
16502
21
220