Skip to content

Commit 80be6da

Browse files
committed
chore: wip
1 parent 5ca3b63 commit 80be6da

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

packages/launchpad/src/dev/shellcode.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,24 @@ __launchpad_chpwd() {
293293
# Ensure global dependencies are available first
294294
__launchpad_setup_global_deps
295295
296-
# First install packages with visible progress messages (stderr visible, stdout hidden)
297-
if LAUNCHPAD_SHELL_INTEGRATION=1 LAUNCHPAD_ORIGINAL_PATH="$LAUNCHPAD_ORIGINAL_PATH" ${launchpadBinary} dev "$project_dir" >/dev/null; then
298-
# Installation succeeded, now get shell environment
296+
# Show initial progress message
297+
if [[ "\$\{LAUNCHPAD_SHOW_ENV_MESSAGES:-true\}" != "false" ]]; then
298+
printf "🔧 Setting up project environment for $(basename "$project_dir")..." >&2
299+
fi
300+
301+
# Run installation and capture output for simplified progress
302+
local temp_output=$(mktemp)
303+
if LAUNCHPAD_SHELL_INTEGRATION=1 LAUNCHPAD_ORIGINAL_PATH="$LAUNCHPAD_ORIGINAL_PATH" ${launchpadBinary} dev "$project_dir" > "$temp_output" 2>&1; then
304+
# Show simplified progress based on what happened
305+
if [[ "\$\{LAUNCHPAD_SHOW_ENV_MESSAGES:-true\}" != "false" ]]; then
306+
if grep -q "cached" "$temp_output"; then
307+
printf "\\r📦 Using cached dependencies..." >&2
308+
elif grep -q "Download" "$temp_output"; then
309+
printf "\\r📦 Installing dependencies..." >&2
310+
fi
311+
fi
312+
rm -f "$temp_output" 2>/dev/null || true
313+
# Installation succeeded, now get shell environment quietly
299314
local temp_file=$(mktemp)
300315
if LAUNCHPAD_SHELL_INTEGRATION=1 LAUNCHPAD_ORIGINAL_PATH="$LAUNCHPAD_ORIGINAL_PATH" ${launchpadBinary} dev "$project_dir" --shell > "$temp_file" 2>/dev/null; then
301316
# Extract shell code from stdout for evaluation
@@ -312,6 +327,7 @@ __launchpad_chpwd() {
312327
rm -f "$temp_file" 2>/dev/null || true
313328
else
314329
setup_exit_code=$?
330+
rm -f "$temp_output" 2>/dev/null || true
315331
fi
316332
317333
# Clear the in-progress flag

0 commit comments

Comments
 (0)