Skip to content

Commit 18ebfb6

Browse files
committed
refactor(cli): use absolute paths for SHELL_CONFIG_UPDATED and fix display
1 parent d2f01f0 commit 18ebfb6

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

packages/cli/install.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -358,10 +358,10 @@ configure_shell_path() {
358358
# Prioritize .zshrc for user notification (easier to source)
359359
if [ $zshrc_result -eq 0 ]; then
360360
result=0
361-
SHELL_CONFIG_UPDATED=".zshrc"
361+
SHELL_CONFIG_UPDATED="$zsh_dir/.zshrc"
362362
elif [ $zshenv_result -eq 0 ]; then
363363
result=0
364-
SHELL_CONFIG_UPDATED=".zshenv"
364+
SHELL_CONFIG_UPDATED="$zsh_dir/.zshenv"
365365
elif [ $zshenv_result -eq 2 ] || [ $zshrc_result -eq 2 ]; then
366366
result=2 # already configured in at least one file
367367
fi
@@ -378,13 +378,13 @@ configure_shell_path() {
378378
# Prioritize .bashrc for user notification (most commonly edited)
379379
if [ $bashrc_result -eq 0 ]; then
380380
result=0
381-
SHELL_CONFIG_UPDATED=".bashrc"
381+
SHELL_CONFIG_UPDATED="$HOME/.bashrc"
382382
elif [ $bash_profile_result -eq 0 ]; then
383383
result=0
384-
SHELL_CONFIG_UPDATED=".bash_profile"
384+
SHELL_CONFIG_UPDATED="$HOME/.bash_profile"
385385
elif [ $profile_result -eq 0 ]; then
386386
result=0
387-
SHELL_CONFIG_UPDATED=".profile"
387+
SHELL_CONFIG_UPDATED="$HOME/.profile"
388388
elif [ $bash_profile_result -eq 2 ] || [ $bashrc_result -eq 2 ] || [ $profile_result -eq 2 ]; then
389389
result=2 # already configured in at least one file
390390
fi
@@ -399,7 +399,7 @@ configure_shell_path() {
399399
echo "# Vite+ bin (https://viteplus.dev)" >> "$fish_config"
400400
echo "source \"$INSTALL_DIR_REF/env.fish\"" >> "$fish_config"
401401
result=0
402-
SHELL_CONFIG_UPDATED=".config/fish/conf.d/vite-plus.fish"
402+
SHELL_CONFIG_UPDATED="$fish_config"
403403
fi
404404
;;
405405
esac
@@ -651,8 +651,9 @@ NPMRC_EOF
651651

652652
# Show restart note if PATH was added to shell config
653653
if [ "$PATH_CONFIGURED" = "true" ] && [ -n "$SHELL_CONFIG_UPDATED" ]; then
654+
local display_config="~${SHELL_CONFIG_UPDATED#"$HOME"}"
654655
echo ""
655-
echo " Note: Run \`source ~/$SHELL_CONFIG_UPDATED\` or restart your terminal."
656+
echo " Note: Run \`source $display_config\` or restart your terminal."
656657
fi
657658

658659
# Show warning if PATH could not be automatically configured

0 commit comments

Comments
 (0)