From 43d679dba3740b3534c77677c2185b7fa8f16491 Mon Sep 17 00:00:00 2001 From: dustinface <35775977+xdustinface@users.noreply.github.com> Date: Wed, 10 Aug 2022 01:27:11 +0200 Subject: [PATCH] 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` --- activated.py | 2 +- activated.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/activated.py b/activated.py index 74c8902b73..59c1710527 100755 --- a/activated.py +++ b/activated.py @@ -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) diff --git a/activated.sh b/activated.sh index 8c01566012..283f61325d 100755 --- a/activated.sh +++ b/activated.sh @@ -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" "$@"