-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: setup ng-dev format pre-commit hook
Whenever a commit is being created, the `yarn ng-dev format changed` command is being executed. This means that the formatter does not need to be run manually.
- Loading branch information
1 parent
3704400
commit 59002e1
Showing
2 changed files
with
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
# Allow for the formatting command to fail without exiting the script. | ||
set +e | ||
|
||
yarn -s ng-dev format staged 2>/dev/null | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "WARNING: failed to run file formatting (ng-dev format staged)" | ||
fi |
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