Skip to content

Commit 11314e7

Browse files
authored
Now works with both piped input and terminals
1 parent 7e1d005 commit 11314e7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.pscale/cli-helper-scripts/use-pscale-docker-image.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ function pscale {
66
local non_interactive=""
77
local command=""
88

9-
# if first arg equals shell, we have to turn off pseudo-tty and set PSCALE_ALLOW_NONINTERACTIVE_SHELL=true
10-
if [ "$1" = "shell" ]; then
9+
# if first arg equals shell, and we are getting input piped in we have to turn off pseudo-tty and set PSCALE_ALLOW_NONINTERACTIVE_SHELL=true
10+
if [ "$1" = "shell" ] && ! [[ -t 0 ]]; then
11+
tty=""
12+
non_interactive="-e PSCALE_ALLOW_NONINTERACTIVE_SHELL=true"
13+
fi
1114
tty=""
1215
non_interactive="-e PSCALE_ALLOW_NONINTERACTIVE_SHELL=true"
1316
fi

0 commit comments

Comments
 (0)