• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1var fs = require("fs");
2var path = require("path");
3
4var hooks = [
5	"post-checkout"
6];
7
8hooks.forEach(function (hook) {
9    var hookInSourceControl = path.resolve(__dirname, "hooks", hook);
10
11    if (fs.existsSync(hookInSourceControl)) {
12        var hookInHiddenDirectory = path.resolve(__dirname, "..", ".git", "hooks", hook);
13
14        if (fs.existsSync(hookInHiddenDirectory)) {
15            fs.unlinkSync(hookInHiddenDirectory);
16        }
17
18        fs.linkSync(hookInSourceControl, hookInHiddenDirectory);
19    }
20});