This repository has been archived by the owner on Nov 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #136 from jamesramsay/init-script
Docs: init script (closes #132)
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
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
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,26 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Script to initialize repo | ||
# - install required node packages | ||
# - install git hooks | ||
|
||
|
||
node=`which node 2>&1` | ||
if [ $? -ne 0 ]; then | ||
echo "Please install NodeJS." | ||
echo "http://nodejs.org/" | ||
exit 1 | ||
fi | ||
|
||
npm=`which npm 2>&1` | ||
if [ $? -ne 0 ]; then | ||
echo "Please install NPM." | ||
fi | ||
|
||
|
||
echo "Installing required npm packages..." | ||
npm install | ||
|
||
echo "Installing git hooks..." | ||
ln -sf commit-msg .git/hooks/commit-msg | ||
ln -sf pre-commit .git/hooks/pre-commit |