-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eee43be
commit ae4a77b
Showing
3 changed files
with
32 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
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,22 @@ | ||
|
||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
# OSX GUI apps do not pick up environment variables the same way as Terminal apps and there are no easy solutions, | ||
# especially as Apple changes the GUI app behavior every release (see https://stackoverflow.com/q/135688/483528). As a | ||
# workaround to allow GitHub Desktop to work, add this (hopefully harmless) setting here. | ||
original_path=$PATH | ||
export PATH=$PATH:/usr/local/bin | ||
|
||
# Store and return last failure from fmt so this can validate every directory passed before exiting | ||
FMT_ERROR=0 | ||
|
||
for file in "$@"; do | ||
sentinel fmt -diff -check "$file" || FMT_ERROR=$? | ||
done | ||
|
||
# reset path to the original value | ||
export PATH=$original_path | ||
|
||
exit ${FMT_ERROR} |