pre-commit: Fix a venv activation issue on linux (#12822)

* pre-commit: Fix a venv activation issue on linux

I ended up with the same issue as in https://github.com/Chia-Network/chia-blockchain/pull/12235 and using `.` instead of `source` (Which is supposed to be the same?) fixed it.

* Make it all `sh`
This commit is contained in:
dustinface 2022-08-10 01:27:11 +02:00 committed by GitHub
parent 91bc4958d1
commit 43d679dba3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -18,7 +18,7 @@ def main(*args: str) -> int:
command = ["powershell", os.fspath(here.joinpath(script)), *args] command = ["powershell", os.fspath(here.joinpath(script)), *args]
else: else:
script = "activated.sh" script = "activated.sh"
command = [os.fspath(here.joinpath(script)), *args] command = ["sh", os.fspath(here.joinpath(script)), *args]
completed_process = subprocess.run(command) completed_process = subprocess.run(command)

View File

@ -1,9 +1,9 @@
#!/bin/bash #!/bin/sh
set -o errexit set -o errexit
SCRIPT_DIRECTORY=$(cd -- "$(dirname -- "$0")"; pwd) SCRIPT_DIRECTORY=$(cd -- "$(dirname -- "$0")"; pwd)
# shellcheck disable=SC1091 # shellcheck disable=SC1091
source "${SCRIPT_DIRECTORY}/venv/bin/activate" . "${SCRIPT_DIRECTORY}/venv/bin/activate"
"$@" "$@"