Created
May 26, 2025 20:50
-
-
Save fepegar/c8b9cc269b1f1ffd35bed1e6fee515da to your computer and use it in GitHub Desktop.
Starship config with modules for uv
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
[python] | |
python_binary = ".venv/bin/python" | |
[custom.uv-version] | |
description = "The currently installed version of uv" | |
shell = "bash" | |
detect_files = [ | |
".python-version", | |
"Pipfile", | |
"__init__.py", | |
"pylock.toml", | |
"pyproject.toml", | |
"requirements.txt", | |
"setup.py", | |
"tox.ini", | |
"uv.lock", | |
] | |
style = "bold fg:#dffe7c" | |
symbol = "by" | |
command = ''' | |
if ! command -v uv >/dev/null; then | |
exit 1 | |
fi | |
uv_version=$(uv --version | awk '{print $2}') | |
emoji=⚡️ | |
printf "%s v%s" "$emoji" "$uv_version" | |
''' | |
format = "$symbol [($output )]($style)" | |
[custom.uv-lock] | |
description = "Symbol representing the state of the lock file" | |
shell = "bash" | |
style = "bold fg:#cf67e2" | |
detect_files = [ | |
".python-version", | |
"Pipfile", | |
"__init__.py", | |
"pylock.toml", | |
"pyproject.toml", | |
"requirements.txt", | |
"setup.py", | |
"tox.ini", | |
"uv.lock", | |
] | |
command = ''' | |
if ! command -v uv >/dev/null; then | |
exit 1 | |
fi | |
suffix="" | |
if uv lock --check-exists >/dev/null; test $? -eq 2; then | |
suffix="?" | |
elif uv lock --check >/dev/null; test $? -eq 2; then | |
suffix="!" | |
fi | |
if [ -n "$suffix" ]; then | |
printf ["$suffix"] | |
fi | |
''' | |
format = "[($output )]($style)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment