mirror of
https://github.com/frappe/bench.git
synced 2025-02-02 10:58:24 +00:00
commit
b12ac648fb
@ -132,10 +132,7 @@ def cli():
|
|||||||
bench_command()
|
bench_command()
|
||||||
|
|
||||||
if in_bench:
|
if in_bench:
|
||||||
if cmd_from_sys in get_frappe_commands():
|
frappe_cmd()
|
||||||
frappe_cmd()
|
|
||||||
else:
|
|
||||||
app_cmd()
|
|
||||||
|
|
||||||
bench_command()
|
bench_command()
|
||||||
|
|
||||||
|
@ -32,8 +32,13 @@ logger = logging.getLogger(bench.PROJECT_NAME)
|
|||||||
|
|
||||||
@lru_cache(maxsize=None)
|
@lru_cache(maxsize=None)
|
||||||
def get_env_cmd(cmd: str, bench_path: str = ".") -> str:
|
def get_env_cmd(cmd: str, bench_path: str = ".") -> str:
|
||||||
# this supports envs' generated by patched virtualenv or venv (which may cause an extra 'local' folder to be created)
|
exact_location = os.path.abspath(
|
||||||
|
os.path.join(bench_path, "env", "bin", cmd.strip("*"))
|
||||||
|
)
|
||||||
|
if os.path.exists(exact_location):
|
||||||
|
return exact_location
|
||||||
|
|
||||||
|
# this supports envs' generated by patched virtualenv or venv (which may cause an extra 'local' folder to be created)
|
||||||
existing_python_bins = glob(
|
existing_python_bins = glob(
|
||||||
os.path.join(bench_path, "env", "**", "bin", cmd), recursive=True
|
os.path.join(bench_path, "env", "**", "bin", cmd), recursive=True
|
||||||
)
|
)
|
||||||
@ -41,8 +46,7 @@ def get_env_cmd(cmd: str, bench_path: str = ".") -> str:
|
|||||||
if existing_python_bins:
|
if existing_python_bins:
|
||||||
return os.path.abspath(existing_python_bins[0])
|
return os.path.abspath(existing_python_bins[0])
|
||||||
|
|
||||||
cmd = cmd.strip("*")
|
return exact_location
|
||||||
return os.path.abspath(os.path.join(bench_path, "env", "bin", cmd))
|
|
||||||
|
|
||||||
|
|
||||||
def get_venv_path(verbose=False, python="python3"):
|
def get_venv_path(verbose=False, python="python3"):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user