Skip to content

Commit

Permalink
Use XDG (i.e. ~/.local/bin) instead of the Cargo home directory in …
Browse files Browse the repository at this point in the history
…the installer (#8420)

Reviving #2236

Basically implements axodotdev/cargo-dist#287
  • Loading branch information
zanieb committed Oct 25, 2024
1 parent 1564c70 commit bdddd41
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -331,4 +331,4 @@ github-custom-job-permissions = { "build-docker" = { packages = "write", content
# Whether to install an updater program
install-updater = false
# Path that installers should place binaries in
install-path = "CARGO_HOME"
install-path = ["$XDG_BIN_HOME/", "$XDG_DATA_HOME/../bin", "~/.local/bin"]
7 changes: 5 additions & 2 deletions docs/configuration/installer.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

## Changing the install path

By default, uv is installed to `~/.cargo/bin`. To change the installation path, use
`UV_INSTALL_DIR`:
By default, uv is installed to `~/.local/bin`. If `XDG_BIN_HOME` is set, it will be used instead.
Similarly, if `XDG_DATA_HOME` is set, the target directory will be inferred as
`XDG_DATA_HOME/../bin`.

To change the installation path, use `UV_INSTALL_DIR`:

=== "macOS and Linux"

Expand Down
6 changes: 3 additions & 3 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,14 @@ If you need to remove uv from your system, just remove the `uv` and `uvx` binari
=== "macOS and Linux"

```console
$ rm ~/.cargo/bin/uv ~/.cargo/bin/uvx
$ rm ~/.local/bin/uv ~/.local/bin/uvx
```

=== "Windows"

```powershell
$ rm $HOME\.cargo\bin\uv.exe
$ rm $HOME\.cargo\bin\uvx.exe
$ rm $HOME\.local\bin\uv.exe
$ rm $HOME\.local\bin\uvx.exe
```

!!! tip
Expand Down

0 comments on commit bdddd41

Please sign in to comment.