Skip to content

Commit

Permalink
Update install.py
Browse files Browse the repository at this point in the history
  • Loading branch information
zackees committed Dec 8, 2023
1 parent 9589ac7 commit 1dd7e40
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 1dd7e40

Please sign in to comment.