-
-
Notifications
You must be signed in to change notification settings - Fork 705
Improved python tool support #673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
if [[ -n "$VIRTUAL_ENV" ]]; then | ||
val_venv=" ($(echo "$VIRTUAL_ENV" | awk -F/ '{print $(NF-1)"/"$NF}'))" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering what happens when VIRTUAL_ENV
contains a newline in the path. The above would output multiple aaa/bbb
pairs. Also, what happens when VIRTUAL_ENV
doesn't contain any /
? It would output /
+ $VIRTUAL_ENV
, but I'm not sure if it's the intended behavior. I'd suggest simply doing
if [[ -n "$VIRTUAL_ENV" ]]; then | |
val_venv=" ($(echo "$VIRTUAL_ENV" | awk -F/ '{print $(NF-1)"/"$NF}'))" | |
if [[ $VIRTUAL_ENV =~ [^/]+/[^/]+$ ]]; then | |
val_venv=" ($BASH_REMATCH)" |
# Si nvm no está instalado, utilizar "njs" | ||
val_py="py $val_py" | ||
if _omb_util_command_exists uv; then | ||
val_py="uv($val_uv) $val_py$val_venv" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The values of val_uv
and val_venv
are only used inside this if-branch. The values of these variables should be calculated inside this branch.
else | ||
# Si nvm no está instalado, utilizar "njs" | ||
val_py="py $val_py" | ||
if _omb_util_command_exists uv; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This else
and if
can be combined to elif
.
just a small update :)