diff --git a/Cargo.toml b/Cargo.toml index 37a0bb2eb27f..1a53a661f4aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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"] diff --git a/docs/configuration/installer.md b/docs/configuration/installer.md index 352689b5cc5a..76347741e57d 100644 --- a/docs/configuration/installer.md +++ b/docs/configuration/installer.md @@ -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" diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index e89a1534e75d..ff0481bc1683 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -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