From f3078bb65a485eee8280fac4ddb8021ac0f2bea6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 30 Jul 2026 01:45:27 +0000 Subject: [PATCH 1/3] Initial plan From 2abb1ef5f007e53eea46325f4034e802046513db Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 30 Jul 2026 01:48:56 +0000 Subject: [PATCH 2/3] fix: standalone install script should not add to shell config on re-run Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com> --- ...tandalone-skip-shell-rerun-2026-7-30-1-48-14.md | 7 +++++++ packages/standalone/install.sh | 14 +++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 .chronus/changes/standalone-skip-shell-rerun-2026-7-30-1-48-14.md diff --git a/.chronus/changes/standalone-skip-shell-rerun-2026-7-30-1-48-14.md b/.chronus/changes/standalone-skip-shell-rerun-2026-7-30-1-48-14.md new file mode 100644 index 00000000000..fe489bff5d2 --- /dev/null +++ b/.chronus/changes/standalone-skip-shell-rerun-2026-7-30-1-48-14.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "@typespec/standalone-cli" +--- + +Fix install script adding duplicate PATH entries to shell config files (`.bashrc`, `.zshrc`, etc.) on subsequent runs. The script now detects if TypeSpec is already configured and skips the shell update. Also fix `--skip-shell` flag which was using an inconsistent variable name and had no effect. diff --git a/packages/standalone/install.sh b/packages/standalone/install.sh index 71477fd60e9..ef75da25042 100755 --- a/packages/standalone/install.sh +++ b/packages/standalone/install.sh @@ -95,7 +95,7 @@ parse_args() { # shift # past value # ;; -s | --skip-shell) - SKIP_SHELL="true" + skip_shell="true" shift # past argument ;; --version) @@ -188,6 +188,10 @@ setup_shell() { if [ "$CURRENT_SHELL" = "zsh" ]; then CONF_FILE=${ZDOTDIR:-$HOME}/.zshrc ensure_containing_dir_exists "$CONF_FILE" + if grep -qF "TYPESPEC_PATH" "$CONF_FILE" 2>/dev/null; then + info "TypeSpec path already configured in $CONF_FILE, skipping." + return + fi echo "Installing for Zsh. Appending the following to $CONF_FILE:" { echo '' @@ -201,6 +205,10 @@ setup_shell() { elif [ "$CURRENT_SHELL" = "fish" ]; then CONF_FILE=$HOME/.config/fish/conf.d/tsp.fish ensure_containing_dir_exists "$CONF_FILE" + if grep -qF "TYPESPEC_PATH" "$CONF_FILE" 2>/dev/null; then + info "TypeSpec path already configured in $CONF_FILE, skipping." + return + fi echo "Installing for Fish. Appending the following to $CONF_FILE:" { echo '' @@ -218,6 +226,10 @@ setup_shell() { CONF_FILE=$HOME/.bashrc fi ensure_containing_dir_exists "$CONF_FILE" + if grep -qF "TYPESPEC_PATH" "$CONF_FILE" 2>/dev/null; then + info "TypeSpec path already configured in $CONF_FILE, skipping." + return + fi echo "Installing for Bash. Appending the following to $CONF_FILE:" { echo '' From 7878d99191172e0cb2c8d6faf7c9c292b3553614 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 30 Jul 2026 11:33:08 +0000 Subject: [PATCH 3/3] style: run formatter on install.sh Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com> --- packages/standalone/install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/standalone/install.sh b/packages/standalone/install.sh index ef75da25042..eb26cb4145e 100755 --- a/packages/standalone/install.sh +++ b/packages/standalone/install.sh @@ -188,7 +188,7 @@ setup_shell() { if [ "$CURRENT_SHELL" = "zsh" ]; then CONF_FILE=${ZDOTDIR:-$HOME}/.zshrc ensure_containing_dir_exists "$CONF_FILE" - if grep -qF "TYPESPEC_PATH" "$CONF_FILE" 2>/dev/null; then + if grep -qF "TYPESPEC_PATH" "$CONF_FILE" 2> /dev/null; then info "TypeSpec path already configured in $CONF_FILE, skipping." return fi @@ -205,7 +205,7 @@ setup_shell() { elif [ "$CURRENT_SHELL" = "fish" ]; then CONF_FILE=$HOME/.config/fish/conf.d/tsp.fish ensure_containing_dir_exists "$CONF_FILE" - if grep -qF "TYPESPEC_PATH" "$CONF_FILE" 2>/dev/null; then + if grep -qF "TYPESPEC_PATH" "$CONF_FILE" 2> /dev/null; then info "TypeSpec path already configured in $CONF_FILE, skipping." return fi @@ -226,7 +226,7 @@ setup_shell() { CONF_FILE=$HOME/.bashrc fi ensure_containing_dir_exists "$CONF_FILE" - if grep -qF "TYPESPEC_PATH" "$CONF_FILE" 2>/dev/null; then + if grep -qF "TYPESPEC_PATH" "$CONF_FILE" 2> /dev/null; then info "TypeSpec path already configured in $CONF_FILE, skipping." return fi