mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-21 08:31:52 +03:00
e7089064eb
* make pre-commit mypy run use regular venv (via activated shim) * & not Invoke-Expression * Update activated.ps1 * install for pre-commit * Update activated.sh * Update .pre-commit-config.yaml
29 lines
588 B
Python
Executable File
29 lines
588 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import os
|
|
import pathlib
|
|
import subprocess
|
|
import sys
|
|
|
|
here = pathlib.Path(__file__).parent
|
|
|
|
|
|
def main(*args: str) -> int:
|
|
if len(args) == 0:
|
|
print("Parameters required")
|
|
return 1
|
|
|
|
if sys.platform == "win32":
|
|
script = "activated.ps1"
|
|
command = ["powershell", os.fspath(here.joinpath(script)), *args]
|
|
else:
|
|
script = "activated.sh"
|
|
command = [os.fspath(here.joinpath(script)), *args]
|
|
|
|
completed_process = subprocess.run(command)
|
|
|
|
return completed_process.returncode
|
|
|
|
|
|
sys.exit(main(*sys.argv[1:]))
|