microsoft / microsoft/aspire

Install script assumes ~/.zshrc is used if zsh detected, this is not always the case

Open
#17,589 2 comments 0 reactions 0 assignees View on GitHub
area-cli triage:bot-seen
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

running `curl -sSL https://aspire.dev/install.sh | bash` on Mac or linux with zsh as the default shell results in `~/.zshrc` being modified (without confirmation), by exporting an updated $PATH with the location of the aspire binaries prepended. In most cases this works out fine. For people that like to store dot files in git and manage them with tools like gnu stow this usually doesn't work. In my case I have a .zshenv file that tells zsh where to find my .zshrc, (which in my case is a symlink `$HOME/.config/zsh`). The `~/.zshrc` file that the aspire install script wrote to is never seen by my zsh config.

To be clear I do not think the bug is that the install script is modifying the wrong file, I think the bug is that it is modifying without clear warnings. I do not want any script updating my zsh config without making it very clear and giving me an option to back out.

I suspect this issue to be the same for bash and other shells.

_**What follows AI Generated analysis of the issue:**_

What the script currently does:

- Default install path is $HOME/.aspire/bin.
- Unless --skip-path is passed, it calls add_to_shell_profile.
- For zsh, it searches these files in order:

```
$HOME/.zshrc
$HOME/.zshenv
$XDG_CONFIG_HOME/zsh/.zshrc
$XDG_CONFIG_HOME/zsh/.zshenv
```

- It picks the first existing file and appends:

```
# Added by get-aspire-cli.sh
export PATH="$HOME/.aspire/bin:$PATH"
```

- If none of those files exist, it creates $HOME/.zshrc.
- There is no prompt before modifying or creating the file.
- The only opt-out is --skip-path, documented in --help, but not surfaced as a confirmation during normal curl | bash.
- --dry-run exists and would show intended changes, but again the default install path does not ask first.

### Expected Behavior

Confirmation before modifying user config, with option to abort and instructions for manual configuration

### Steps To Reproduce

Run `curl -sSL https://aspire.dev/install.sh | bash` on a Mac that doesn't have aspire installed

### Exceptions (if any)

_No response_

### Aspire doctor output

_No response_

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the install.sh entry point and the add_to_shell_profile path described in the issue; inspect how --skip-path and --dry-run currently handle shell profile changes. Reproduce the default installation behavior, then make completion mean users are warned before config changes, can abort, and receive manual configuration instructions.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, zsh
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.