git-validate
Advanced tools
Comparing version 2.0.3 to 2.0.5
@@ -110,6 +110,10 @@ var Fs = require('fs'); | ||
var sourceStream = Fs.createReadStream(source); | ||
var targetStream = Fs.createWriteStream(target, { flag: 'w', mode: mode }); | ||
var sourceContent = ''; | ||
try { | ||
sourceContent = Fs.readFileSync(source); | ||
} catch (e) { | ||
/* no source to copy */ | ||
} | ||
sourceStream.pipe(targetStream); | ||
Fs.writeFileSync(target, sourceContent, { flag: 'w', mode: mode }); | ||
}; | ||
@@ -116,0 +120,0 @@ |
{ | ||
"name": "git-validate", | ||
"version": "2.0.3", | ||
"version": "2.0.5", | ||
"description": "the extensible core of precommit-hook", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -52,2 +52,4 @@ var ChildProcess = require('child_process'); | ||
internals.createFile('project4', 'this', 'is', 'too', 'deep', 'to', 'find', 'package.json'); | ||
internals.mkdir('project5', '.git'); | ||
internals.createFile('project5', 'package.json'); | ||
done(); | ||
@@ -213,3 +215,3 @@ }; | ||
expect(projects).to.be.an.array(); | ||
expect(projects).to.have.length(4); | ||
expect(projects).to.have.length(5); | ||
expect(projects).to.contain(Path.dirname(__dirname)); | ||
@@ -236,2 +238,9 @@ expect(projects).to.contain(Path.join(internals.fixturePath, 'project1')); | ||
it('can install a hook to a .git directory without hooks subdir', function (done) { | ||
Utils.installHooks('pre-commit', Path.join(internals.fixturePath, 'project5')); | ||
expect(Fs.existsSync(Path.join(internals.fixturePath, 'project5', '.git', 'hooks', 'pre-commit'))).to.be.true(); | ||
done(); | ||
}); | ||
it('can install multiple hooks at once', function (done) { | ||
@@ -238,0 +247,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
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
38049
10
482