Skip to content

Commit f56a4be

Browse files
committed
git-hooks is a registered npm module. No need to use the full path.
1 parent 150ea52 commit f56a4be

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

lib/git-hooks.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,7 @@ module.exports = {
5151
}
5252

5353
var hookTemplate = fs.readFileSync(__dirname + '/' + HOOKS_TEMPLATE_FILE_NAME);
54-
var pathToGitHooks = path.relative(hooksPath, __dirname);
55-
// Fix non-POSIX (Windows) separators
56-
pathToGitHooks = pathToGitHooks.replace(new RegExp(path.sep.replace(/\\/g, '\\$&'), 'g'), '/');
57-
var hook = util.format(hookTemplate.toString(), pathToGitHooks);
54+
var hook = hookTemplate.toString();
5855

5956
fsHelpers.makeDir(hooksPath);
6057
HOOKS.forEach(function (hookName) {

lib/hook-template.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env node
22

33
try {
4-
require('%s/git-hooks').run(__filename, process.argv[2], function (code) {
4+
require('git-hooks').run(__filename, process.argv[2], function (code) {
55
process.exit(code);
66
});
77
} catch (e) {

0 commit comments

Comments
 (0)