From 1dd7e40ef5d55d07aa44344150b6a42819b93c9f Mon Sep 17 00:00:00 2001 From: Zachary Vorhies Date: Thu, 7 Dec 2023 19:03:44 -0800 Subject: [PATCH] Update install.py --- install.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/install.py b/install.py index 1d18385..ab38fab 100644 --- a/install.py +++ b/install.py @@ -133,10 +133,6 @@ def create_virtual_environment() -> None: except subprocess.CalledProcessError as exc: warnings.warn(f"couldn't make virtual environment because of {exc}") raise exc - with open("activate.sh", encoding="utf-8", mode="w") as fd: - fd.write(_ACTIVATE_SH) - if sys.platform != "win32": - _exe("chmod +x activate.sh") def check_platform() -> None: @@ -177,6 +173,13 @@ def main() -> int: else: print(f'{os.path.abspath("venv")} already exists') + if not os.path.exists(HERE, "activate.sh"): + with open("activate.sh", encoding="utf-8", mode="w") as fd: + fd.write(_ACTIVATE_SH) + if sys.platform != "win32": + _exe("chmod +x activate.sh") + _exe("git add ./activate.sh --chmod=+x") + # Linux/MacOS uses bin and Windows uses Script, so create # a soft link in order to always refer to bin for all # platforms.