Skip to content

Commit 6737ef7

Browse files
committed
chore: wip
1 parent f28e845 commit 6737ef7

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

packages/launchpad/src/dev/shellcode.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ __launchpad_switch_environment() {
321321
# Non-blocking on-demand install with retry backoff (no artificial timeout)
322322
local cache_dir="$HOME/.cache/launchpad/shell_cache"
323323
mkdir -p "$cache_dir" 2>/dev/null || true
324-
local backoff_marker="$cache_dir/install_backoff_$(echo "$env_dir" | sed 's/\//_/g')"
324+
local backoff_marker="$cache_dir/install_backoff_$(echo "$env_dir" | tr '/' '_')"
325325
326326
local now_s=$(date +%s 2>/dev/null || echo 0)
327327
local retry_after=600 # 10 minutes
@@ -334,8 +334,11 @@ __launchpad_switch_environment() {
334334
fi
335335
336336
if [[ "$should_attempt" -eq 1 ]]; then
337-
: > "$backoff_marker" 2>/dev/null || true
338-
if LAUNCHPAD_DISABLE_SHELL_INTEGRATION=1 LAUNCHPAD_SHELL_INTEGRATION=1 ${launchpadBinary} install "$project_dir"; then
337+
# Suppress installer output in hooks to avoid stray blank lines in the prompt
338+
if LAUNCHPAD_DISABLE_SHELL_INTEGRATION=1 LAUNCHPAD_SHELL_INTEGRATION=1 ${launchpadBinary} install "$project_dir" >/dev/null 2>&1; then
339+
if [[ "$verbose_mode" == "true" && "$__lp_should_verbose_print" == "1" ]]; then
340+
printf "📦 Installed project dependencies (on-demand)\n" >&2
341+
fi
339342
if [[ -d "$env_dir/bin" ]]; then
340343
export LAUNCHPAD_CURRENT_PROJECT="$project_dir"
341344
export LAUNCHPAD_ENV_BIN_PATH="$env_dir/bin"
@@ -346,8 +349,12 @@ __launchpad_switch_environment() {
346349
if [[ "$verbose_mode" == "true" && "$__lp_should_verbose_print" == "1" ]]; then
347350
printf "✅ Activated environment after install: %s\n" "$env_dir" >&2
348351
fi
352+
# Clear any backoff marker after successful install
353+
rm -f "$backoff_marker" 2>/dev/null || true
349354
fi
350355
else
356+
# Touch backoff marker only on failure to avoid repeated attempts
357+
: > "$backoff_marker" 2>/dev/null || true
351358
if [[ "$verbose_mode" == "true" && "$__lp_should_verbose_print" == "1" ]]; then
352359
printf "⏭️ Deferred on-demand install. Run 'launchpad install %q' manually.\n" "$project_dir" >&2
353360
fi

0 commit comments

Comments
 (0)