mirror of
https://github.com/frappe/bench.git
synced 2025-01-10 00:37:51 +00:00
fix: Fetch env python if exists before returning fallback
This commit is contained in:
parent
0cd5fca322
commit
e5fa4df5f9
@ -6,6 +6,7 @@ import shutil
|
||||
import json
|
||||
import sys
|
||||
import logging
|
||||
from glob import glob
|
||||
from typing import List, MutableSequence, TYPE_CHECKING, Union
|
||||
|
||||
# imports - module imports
|
||||
@ -71,6 +72,11 @@ class Bench(Base, Validator):
|
||||
|
||||
@property
|
||||
def python(self) -> str:
|
||||
existing_python_bins = glob(f"{self.name}/env/bin/python*")
|
||||
|
||||
if existing_python_bins:
|
||||
return existing_python_bins[0]
|
||||
|
||||
return get_env_cmd("python", bench_path=self.name)
|
||||
|
||||
@property
|
||||
|
@ -40,7 +40,7 @@ def get_venv_path(verbose=False, python="python3"):
|
||||
if is_venv_installed:
|
||||
return f"{python} -m venv"
|
||||
else:
|
||||
log("virtualenv cannot be found", level=2)
|
||||
log("venv cannot be found", level=2)
|
||||
|
||||
|
||||
def update_node_packages(bench_path=".", apps=None):
|
||||
|
Loading…
Reference in New Issue
Block a user