Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 71601f4

Browse files
authored
fix: Fix log wrapper for vite in scripts/develop.sh (#5030)
The pid tracking refactor resulted in the pipe while echo to block the script from continuing and showing the banner at the end. This change redirects the stdout for the `start_cmd` to a new fd which `while` is reading from.
1 parent 823b02a commit 71601f4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/develop.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ exit_cleanup() {
7272
}
7373
start_cmd() {
7474
echo "== CMD: $*" >&2
75-
"$@" || fatal "CMD: $*" &
75+
"$@" 2>&1 || fatal "CMD: $*" &
7676
pids+=("$!")
7777
}
7878
wait_cmds() {
@@ -138,11 +138,11 @@ fatal() {
138138
fi
139139

140140
# Start the frontend once we have a template up and running
141-
CODER_HOST=http://127.0.0.1:3000 start_cmd yarn --cwd=./site dev --host | {
141+
CODER_HOST=http://127.0.0.1:3000 start_cmd yarn --cwd=./site dev --host > >(
142142
while read -r line; do
143143
echo "[SITE] $(date -Iseconds): $line"
144144
done
145-
}
145+
)
146146

147147
interfaces=(localhost)
148148
if which ip >/dev/null 2>&1; then

0 commit comments

Comments
 (0)