-
Notifications
You must be signed in to change notification settings - Fork 37
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
096e7aa
commit ef5b90e
Showing
2 changed files
with
10 additions
and
7 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 |
---|---|---|
@@ -1,10 +1,14 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
if [[ "$OSTYPE" == "linux-gnu"* || "$OSTYPE" == "darwin"* ]] &&!("$PSVersionTable.PSVersion.Major" -ge 5); then | ||
# Unix-like OS detected, proceed with redirection | ||
exec >/dev/tty 2>&1 | ||
elif $PSVersionTable.PSVersion.Major -lt 5; then | ||
# PowerShell version less than 5, assume Unix-like environment | ||
exec >/dev/tty 2>&1 | ||
|
||
# Detect /dev/tty using readlink and fd/2 | ||
tty=$(readlink /proc/$$/fd/2) | ||
|
||
# Use the detected tty for redirection | ||
if [[ -n "$tty" ]]; then | ||
exec >"$tty" 2>&1 | ||
else | ||
echo "Could not detect /dev/tty" | ||
fi | ||
|
||
yarn lint-staged |
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