mirror of
https://github.com/frappe/bench.git
synced 2025-01-10 00:37:51 +00:00
fix(utils): Strip * from cmd via get_env_cmd
This commit is contained in:
parent
78742b9546
commit
6ae1997bff
@ -22,17 +22,18 @@ logger = logging.getLogger(bench.PROJECT_NAME)
|
||||
|
||||
|
||||
@lru_cache(maxsize=None)
|
||||
def get_env_cmd(cmd, bench_path="."):
|
||||
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)
|
||||
|
||||
existing_python_bins = glob(
|
||||
os.path.abspath(os.path.join(bench_path, "env", "**", "bin", cmd)), recursive=True
|
||||
os.path.join(bench_path, "env", "**", "bin", cmd), recursive=True
|
||||
)
|
||||
|
||||
if existing_python_bins:
|
||||
return existing_python_bins[0]
|
||||
|
||||
return os.path.abspath(os.path.join(bench_path, "env", "bin", cmd))
|
||||
cmd = cmd.strip("*")
|
||||
return os.path.join(bench_path, "env", "bin", cmd)
|
||||
|
||||
|
||||
def get_venv_path(verbose=False, python="python3"):
|
||||
|
Loading…
Reference in New Issue
Block a user