Created
March 4, 2026 13:33
-
-
Save hellt/6bdb2c2c1ac14cfb817a0e6b412fbc16 to your computer and use it in GitHub Desktop.
uvx with git+https support
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| set -eu | |
| UV_INSTALL_DIR="${UV_INSTALL_DIR:-$HOME/.local/bin}" | |
| if command -v uv >/dev/null 2>&1; then | |
| UV_BIN="uv" | |
| elif [ -x "$UV_INSTALL_DIR/uv" ]; then | |
| UV_BIN="$UV_INSTALL_DIR/uv" | |
| else | |
| echo "Installing uv..." | |
| if command -v curl >/dev/null 2>&1; then | |
| fetch_cmd="curl -LsSf" | |
| elif command -v wget >/dev/null 2>&1; then | |
| fetch_cmd="wget -qO-" | |
| else | |
| echo "error: need 'curl' or 'wget' (commands not found)" >&2 | |
| exit 1 | |
| fi | |
| $fetch_cmd https://astral.sh/uv/install.sh | sh | |
| UV_BIN="$UV_INSTALL_DIR/uv" | |
| fi | |
| echo "Installing foo@latest..." | |
| "$UV_BIN" tool install "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment