Skip to content

Commit 383d4e7

Browse files
committed
Use XDG (i.e. ~/.local/bin) instead of the Cargo home directory in the installer (#8420)
Reviving #2236 Basically implements axodotdev/cargo-dist#287
1 parent 8034de7 commit 383d4e7

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,4 +335,4 @@ github-custom-job-permissions = { "build-docker" = { packages = "write", content
335335
# Whether to install an updater program
336336
install-updater = false
337337
# Path that installers should place binaries in
338-
install-path = "CARGO_HOME"
338+
install-path = ["$XDG_BIN_HOME/", "$XDG_DATA_HOME/../bin", "~/.local/bin"]

docs/configuration/installer.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22

33
## Changing the install path
44

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

811
=== "macOS and Linux"
912

docs/getting-started/installation.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,14 @@ If you need to remove uv from your system, just remove the `uv` and `uvx` binari
185185
=== "macOS and Linux"
186186

187187
```console
188-
$ rm ~/.cargo/bin/uv ~/.cargo/bin/uvx
188+
$ rm ~/.local/bin/uv ~/.local/bin/uvx
189189
```
190190

191191
=== "Windows"
192192

193193
```powershell
194-
$ rm $HOME\.cargo\bin\uv.exe
195-
$ rm $HOME\.cargo\bin\uvx.exe
194+
$ rm $HOME\.local\bin\uv.exe
195+
$ rm $HOME\.local\bin\uvx.exe
196196
```
197197

198198
!!! tip

0 commit comments

Comments
 (0)