Skip to content

Commit 2b5ac5f

Browse files
typicodejesstelfordjoelgallanttanhauhauikokostya
authored
Enable stdin if terminal (#415)
Co-authored-by: Jess Telford <[email protected]> Co-authored-by: Joel Gallant <[email protected]> Co-authored-by: Tan Li Hau <[email protected]> Co-authored-by: ikokostya <[email protected]>
1 parent 73c0ad7 commit 2b5ac5f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/installer/__tests__/__snapshots__/getScript.ts.snap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ if ! command -v node >/dev/null 2>&1; then
2929
fi
3030
3131
if [ -f \\"$scriptPath\\" ]; then
32+
if [ -t 1 ]; then
33+
exec < /dev/tty
34+
fi
3235
if [ -f ~/.huskyrc ]; then
3336
debug \\"source ~/.huskyrc\\"
3437
source ~/.huskyrc
@@ -66,6 +69,9 @@ debug() {
6669
debug \\"$hookName hook started...\\"
6770
6871
if [ -f \\"$scriptPath\\" ]; then
72+
if [ -t 1 ]; then
73+
exec < /dev/tty
74+
fi
6975
if [ -f ~/.huskyrc ]; then
7076
debug \\"source ~/.huskyrc\\"
7177
source ~/.huskyrc

src/installer/getScript.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ fi
6464
: ''
6565
}
6666
if [ -f "$scriptPath" ]; then
67+
if [ -t 1 ]; then
68+
exec < /dev/tty
69+
fi
6770
if [ -f ${huskyrc} ]; then
6871
debug "source ${huskyrc}"
6972
source ${huskyrc}

0 commit comments

Comments
 (0)