Skip to content

Commit 2d422e4

Browse files
authored
fix(self-hosted): use subshell for terminal checks in setup.sh (supabase#46779)
1 parent 289accd commit 2d422e4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

docker/setup.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ die() { printf "ERROR: %s\n" "$*" >&2; exit 1; }
6767
# Falls back to the default with -y or when no controlling terminal exists.
6868
ask() {
6969
# ask <prompt> <default> -> echoes chosen value
70-
if [ "$ASSUME_YES" = "1" ] || ! { : > /dev/tty; } 2>/dev/null; then
70+
if [ "$ASSUME_YES" = "1" ] || ! ( : < /dev/tty ) 2>/dev/null; then
7171
printf '%s' "$2"
7272
return
7373
fi
@@ -281,8 +281,8 @@ current_site_url=$(read_env SITE_URL)
281281
[ -z "$current_api_url" ] && current_api_url="$current_public_url"
282282
[ -z "$current_site_url" ] && current_site_url="http://localhost:3000"
283283

284-
if [ "$ASSUME_YES" = "1" ] || ! { : > /dev/tty; } 2>/dev/null; then
285-
log "Non-interactive: keeping default URLs (edit .env to change)"
284+
if [ "$ASSUME_YES" = "1" ] || ! ( : < /dev/tty ) 2>/dev/null; then
285+
log "Non-interactive: using default URLs (edit .env to change)"
286286
else
287287
echo ""
288288
echo "Configure the main URLs (press Enter to accept the default)."

0 commit comments

Comments
 (0)