Skip to content

Commit 12e3399

Browse files
committed
chore: wip
1 parent a3062d6 commit 12e3399

File tree

2 files changed

+24
-28
lines changed

2 files changed

+24
-28
lines changed

packages/launchpad/src/commands/install.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ async function installPackagesGlobally(packages: string[], options: { verbose?:
138138

139139
if (!options.quiet) {
140140
if (results.length > 0) {
141-
console.log(`🎉 Successfully installed ${packages.join(', ')} globally (${results.length} ${results.length === 1 ? 'binary' : 'binaries'})`)
141+
console.log(`🎉 Successfully installed ${packages.join(', ')} globally \x1B[3m\x1B[2m(${results.length} ${results.length === 1 ? 'binary' : 'binaries'})\x1B[0m`)
142142
results.forEach(f => console.log(` ${f}`))
143143
}
144144
else {
@@ -434,7 +434,7 @@ async function installGlobalDependencies(options: { dryRun?: boolean, quiet?: bo
434434

435435
if (!options.quiet) {
436436
if (results.length > 0)
437-
console.log(`🎉 Successfully installed ${filteredPackages.length} global dependencies (${results.length} binaries)`)
437+
console.log(`🎉 Successfully installed ${filteredPackages.length} global dependencies \x1B[3m\x1B[2m(${results.length} binaries)\x1B[0m`)
438438
else console.log('✅ All global dependencies were already installed')
439439
}
440440

@@ -539,7 +539,7 @@ const command: Command = {
539539
triggerShellGlobalRefresh()
540540
if (!opts.quiet) {
541541
if (results.length > 0) {
542-
console.log(`🎉 Successfully installed ${pkgs.join(', ')} (${results.length} ${results.length === 1 ? 'binary' : 'binaries'})`)
542+
console.log(`🎉 Successfully installed ${pkgs.join(', ')} \x1B[3m\x1B[2m(${results.length} ${results.length === 1 ? 'binary' : 'binaries'})\x1B[0m`)
543543
results.forEach(f => console.log(` ${f}`))
544544
}
545545
else {

packages/launchpad/src/dev/shellcode.ts

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ export function shellcode(_testMode: boolean = false): string {
1515

1616
// Use config-backed shell message configuration with {path} substitution
1717
const showMessages = config.showShellMessages ? 'true' : 'false'
18-
// Replace {path} with shell-evaluated basename
18+
// Replace {path} with shell-evaluated basename (italic)
1919
const activationMessage = (config.shellActivationMessage || '✅ Environment activated for {path}')
20-
.replace('{path}', '$(basename "$project_dir")')
20+
.replace('{path}', '\\x1B[3m$(basename "$project_dir")\\x1B[0m')
21+
.replace(/\n$/, '')
2122
const deactivationMessage = config.shellDeactivationMessage || 'Environment deactivated'
2223

2324
// Verbosity: default to verbose for shell integration unless explicitly disabled
@@ -263,18 +264,15 @@ __launchpad_switch_environment() {
263264
# If no project found, check if we need to deactivate current project
264265
if [[ -z "$project_dir" ]]; then
265266
# If we were in a project but now we're not, deactivate it
266-
if [[ -n "$LAUNCHPAD_CURRENT_PROJECT" && -n "$LAUNCHPAD_ENV_BIN_PATH" ]]; then
267-
# Remove project-specific paths from PATH
268-
export PATH=$(echo "$PATH" | sed "s|$LAUNCHPAD_ENV_BIN_PATH:||g" | sed "s|:$LAUNCHPAD_ENV_BIN_PATH||g" | sed "s|^$LAUNCHPAD_ENV_BIN_PATH$||g")
269-
270-
# Show deactivation message if enabled (only once per deactivation)
271-
if [[ "${showMessages}" == "true" && -n "$__LAUNCHPAD_LAST_ACTIVATION_KEY" ]]; then
272-
printf "${deactivationMessage}\\n" >&2
267+
if [[ -n "$__LAUNCHPAD_LAST_ACTIVATION_KEY" ]]; then
268+
# Remove project-specific paths from PATH if they exist
269+
if [[ -n "$LAUNCHPAD_ENV_BIN_PATH" ]]; then
270+
export PATH=$(echo "$PATH" | sed "s|$LAUNCHPAD_ENV_BIN_PATH:||g" | sed "s|:$LAUNCHPAD_ENV_BIN_PATH||g" | sed "s|^$LAUNCHPAD_ENV_BIN_PATH$||g")
273271
fi
274272
275-
# Verbose: deactivated environment
276-
if [[ "$verbose_mode" == "true" && "$__lp_should_verbose_print" == "1" ]]; then
277-
printf "⚪ Deactivated environment\n" >&2
273+
# Show deactivation message if enabled
274+
if [[ "${showMessages}" == "true" ]]; then
275+
printf "${deactivationMessage}\\n" >&2
278276
fi
279277
280278
unset LAUNCHPAD_CURRENT_PROJECT
@@ -325,22 +323,20 @@ __launchpad_switch_environment() {
325323
fi
326324
fi
327325
326+
# Show activation message if enabled (when project changes)
327+
if [[ "${showMessages}" == "true" ]]; then
328+
if [[ "$__LAUNCHPAD_LAST_ACTIVATION_KEY" != "$project_dir" ]]; then
329+
printf "${activationMessage}\n" >&2
330+
fi
331+
fi
332+
export __LAUNCHPAD_LAST_ACTIVATION_KEY="$project_dir"
333+
328334
# If environment exists, activate it
329335
if [[ -d "$env_dir/bin" ]]; then
330336
export LAUNCHPAD_CURRENT_PROJECT="$project_dir"
331-
export LAUNCHPAD_ENV_BIN_PATH="$env_dir/bin"
337+
export LAUNCHPAD_ENV_BIN_PATH="$env_dir/bin"
332338
export PATH="$env_dir/bin:$PATH"
333-
334-
# Show activation message if enabled (only when env changes)
335-
if [[ "${showMessages}" == "true" ]]; then
336-
if [[ "$__LAUNCHPAD_LAST_ACTIVATION_KEY" != "$env_dir" ]]; then
337-
printf "${activationMessage} " >&2
338-
fi
339-
fi
340-
export __LAUNCHPAD_LAST_ACTIVATION_KEY="$env_dir"
341-
342339
# Removed verbose activated environment path message
343-
344340
# Ensure dynamic linker can find Launchpad-managed libraries (macOS/Linux)
345341
# Build a list of library directories from the active environment and global install
346342
__lp_add_unique_colon_path() {
@@ -391,8 +387,8 @@ __launchpad_switch_environment() {
391387
fi
392388
done
393389
else
394-
# Environment not ready - skip setup during shell integration to prevent hanging
395-
# User can run 'launchpad install <project>' manually when needed
390+
# Environment not ready - user can run 'launchpad install <project>' manually when needed
391+
:
396392
fi
397393
fi
398394

0 commit comments

Comments
 (0)