1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2026-05-09 14:01:35 +02:00

Zsh/Nvim: made python handling more readably

This commit is contained in:
2026-05-08 02:39:44 +02:00
parent ec77543d6b
commit f11f68c751
2 changed files with 4 additions and 4 deletions

View File

@@ -14,7 +14,7 @@ vipercmd="carbon" #"silicon"
cd "$dir" || exit
has_uv_project() {
has_python_version() {
dir="$PWD"
while [ "$dir" != "/" ]; do
if [ -f "$dir/.python-version" ] || [ -f "$dir/pyproject.toml" ]; then
@@ -45,7 +45,7 @@ case "$file" in
*\.mom) refer -PS -e "$file" | groff -mom -kept -T pdf >"$base".pdf ;;
*\.ms) refer -PS -e "$file" | groff -me -ms -kept -T pdf >"$base".pdf ;;
*\.py)
if has_uv_project; then
if has_python_version; then
uv run python "$file"
else
python3 "$file"