Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
"build": "npm run build:compiler && npm run build:tests",
"build:compiler": "jake local",
"build:tests": "jake tests",
"clean": "jake clean"
"clean": "jake clean",
"jake": "jake",
"postinstall": "node scripts/link-hooks.js"
},
"browser": {
"buffer": false,
Expand Down
2 changes: 2 additions & 0 deletions scripts/hooks/post-checkout
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
npm run jake -- generate-diagnostics
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just jake generate-diagnostics?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works when jake isn't installed globally. 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

20 changes: 20 additions & 0 deletions scripts/link-hooks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
var fs = require("fs");
var path = require("path");

var hooks = [
"post-checkout"
];

hooks.forEach(function (hook) {
var hookInSourceControl = path.resolve(__dirname, "hooks", hook);

if (fs.existsSync(hookInSourceControl)) {
var hookInHiddenDirectory = path.resolve(__dirname, "..", ".git", "hooks", hook);

if (fs.existsSync(hookInHiddenDirectory)) {
fs.unlinkSync(hookInHiddenDirectory);
}

fs.linkSync(hookInSourceControl, hookInHiddenDirectory);
}
});