-
Notifications
You must be signed in to change notification settings - Fork 788
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(postinstall): use node, more conditionals (#520)
* fix(postinstall): use node, more conditionals Closes #516 * chore: move fs-extra to devDependencies
- Loading branch information
1 parent
35b598a
commit f5b5299
Showing
3 changed files
with
17 additions
and
9 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
var fs = require('fs') | ||
|
||
if (fs.existsSync(".git/hooks")) { | ||
let commitMsg = '.git/hooks/commit-msg' | ||
if (!fs.existsSync(commitMsg)) { | ||
let angularPrecommit = "./node_modules/angular-precommit/index.js" | ||
if (fs.existsSync(angularPrecommit)) { | ||
var fsExtra = require('fs-extra') | ||
fsExtra.copy(angularPrecommit, commitMsg, (err) => { | ||
if (err) throw err | ||
console.log("Installing git pre-commit hook") | ||
}) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters