Skip to content

Commit

Permalink
pre-commit: Fix a venv activation issue on linux (Chia-Network#12822)
Browse files Browse the repository at this point in the history
* pre-commit: Fix a venv activation issue on linux

I ended up with the same issue as in Chia-Network#12235 and using `.` instead of `source` (Which is supposed to be the same?) fixed it.

* Make it all `sh`
  • Loading branch information
xdustinface authored Aug 9, 2022
1 parent 91bc495 commit 43d679d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion activated.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def main(*args: str) -> int:
command = ["powershell", os.fspath(here.joinpath(script)), *args]
else:
script = "activated.sh"
command = [os.fspath(here.joinpath(script)), *args]
command = ["sh", os.fspath(here.joinpath(script)), *args]

completed_process = subprocess.run(command)

Expand Down
4 changes: 2 additions & 2 deletions activated.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
#!/bin/sh

set -o errexit

SCRIPT_DIRECTORY=$(cd -- "$(dirname -- "$0")"; pwd)
# shellcheck disable=SC1091
source "${SCRIPT_DIRECTORY}/venv/bin/activate"
. "${SCRIPT_DIRECTORY}/venv/bin/activate"

"$@"

0 comments on commit 43d679d

Please sign in to comment.