Skip to content

Commit

Permalink
fix(postinstall): use node, more conditionals (#520)
Browse files Browse the repository at this point in the history
* fix(postinstall): use node, more conditionals

Closes #516

* chore: move fs-extra to devDependencies
  • Loading branch information
marcysutton committed Dec 12, 2017
1 parent 3b88acd commit 54f7ddd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
8 changes: 0 additions & 8 deletions bin/postinstall.sh

This file was deleted.

4 changes: 2 additions & 2 deletions build/utils/postinstall.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
var fs = require('fs')

if (fs.existsSync(".git/hooks")) {
var commitMsg = '.git/hooks/commit-msg'
let commitMsg = '.git/hooks/commit-msg'
if (!fs.existsSync(commitMsg)) {
var angularPrecommit = "./node_modules/angular-precommit/index.js"
let angularPrecommit = "./node_modules/angular-precommit/index.js"
if (fs.existsSync(angularPrecommit)) {
var fsExtra = require('fs-extra')
fsExtra.copy(angularPrecommit, commitMsg, (err) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"version": "echo \"use 'npm run release' to bump axe-core version\" && exit 1",
"release": "standard-version && node build/sri-update",
"prepublishOnly": "grunt build && node build/sri-update --validate",
"postinstall": "cd .git/hooks/ && cp ../../node_modules/angular-precommit/index.js commit-msg && cd ../../"
"postinstall": "node build/utils/postinstall.js"
},
"devDependencies": {
"angular-precommit": "^1.0.3",
Expand Down

0 comments on commit 54f7ddd

Please sign in to comment.