Compare commits
4 commits
d14ae1725e
...
a3cf76b28a
Author | SHA1 | Date | |
---|---|---|---|
a3cf76b28a | |||
ee3c61dad3 | |||
a14e9b941b | |||
f507f0536e |
2 changed files with 10 additions and 9 deletions
|
@ -3,8 +3,10 @@
|
|||
__version__ = "0.0.1"
|
||||
|
||||
import sys
|
||||
from os import environ, pathsep
|
||||
from pathlib import Path
|
||||
|
||||
import env
|
||||
from rwx import fs
|
||||
from rwx.log import stream as log
|
||||
from rwx.ps import run
|
||||
|
@ -61,6 +63,9 @@ def list_environment_variables() -> None:
|
|||
|
||||
|
||||
def main(main: str) -> None:
|
||||
paths = environ["PATH"].split(pathsep)
|
||||
if env.SPCD_PYTHON_VENV_BINARIES not in paths:
|
||||
environ["PATH"] = pathsep.join([env.SPCD_PYTHON_VENV_BINARIES, *paths])
|
||||
path, *arguments = sys.argv
|
||||
name = Path(path).name
|
||||
if name == "__main__.py":
|
||||
|
|
|
@ -2,17 +2,13 @@
|
|||
|
||||
"""Entry point."""
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
import env
|
||||
|
||||
if env.SPCD_PYTHON_VENV_PACKAGES not in sys.path:
|
||||
sys.path.insert(0, env.SPCD_PYTHON_VENV_PACKAGES)
|
||||
import spcd
|
||||
|
||||
if __name__ == "__main__":
|
||||
os.environ["PATH"] = os.pathsep.join(
|
||||
[env.SPCD_PYTHON_VENV_BINARIES, os.environ["PATH"]]
|
||||
)
|
||||
spcd.main(__file__)
|
||||
if env.SPCD_PYTHON_VENV_PACKAGES not in sys.path:
|
||||
sys.path.insert(0, env.SPCD_PYTHON_VENV_PACKAGES)
|
||||
from spcd import main
|
||||
|
||||
main(__file__)
|
||||
|
|
Loading…
Reference in a new issue