move to init
This commit is contained in:
parent
f507f0536e
commit
a14e9b941b
2 changed files with 5 additions and 4 deletions
|
@ -3,8 +3,10 @@
|
||||||
__version__ = "0.0.1"
|
__version__ = "0.0.1"
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
from os import environ, pathsep
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
import env
|
||||||
from rwx import fs
|
from rwx import fs
|
||||||
from rwx.log import stream as log
|
from rwx.log import stream as log
|
||||||
from rwx.ps import run
|
from rwx.ps import run
|
||||||
|
@ -61,6 +63,9 @@ def list_environment_variables() -> None:
|
||||||
|
|
||||||
|
|
||||||
def main(main: str) -> 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
|
path, *arguments = sys.argv
|
||||||
name = Path(path).name
|
name = Path(path).name
|
||||||
if name == "__main__.py":
|
if name == "__main__.py":
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
"""Entry point."""
|
"""Entry point."""
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from os import environ, pathsep
|
|
||||||
|
|
||||||
import env
|
import env
|
||||||
|
|
||||||
|
@ -12,7 +11,4 @@ if env.SPCD_PYTHON_VENV_PACKAGES not in sys.path:
|
||||||
import spcd
|
import spcd
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
paths = environ["PATH"].split(pathsep)
|
|
||||||
if env.SPCD_PYTHON_VENV_BINARIES not in paths:
|
|
||||||
environ["PATH"] = pathsep.join([env.SPCD_PYTHON_VENV_BINARIES, *paths])
|
|
||||||
spcd.main(__file__)
|
spcd.main(__file__)
|
||||||
|
|
Loading…
Reference in a new issue