mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-04 09:44:14 +00:00
Fix generate_supported pre commit to run in venv (#1085)
I noticed after building a new linux instance that running `git commit` when the virtual environment is not active causes the pre-commit to fail, as the `generate_supported` hook is not explicitly configured to run in the virtual env. This PR calls `generate_supported` via the `run-in-env.sh` script.
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# pre-commit by default runs hooks in an isolated environment.
|
||||
# For some hooks it's needed to run in the virtual environment so this script will activate it.
|
||||
|
||||
OS_KERNEL=$(uname -s)
|
||||
OS_VER=$(uname -v)
|
||||
if [[ ( $OS_KERNEL == "Linux" && $OS_VER == *"Microsoft"* ) ]]; then
|
||||
echo "Pre-commit hook needs git-bash to run. It cannot run in the windows linux subsystem."
|
||||
echo "Add git bin directory to the front of your path variable, e.g:"
|
||||
echo "set PATH=C:\Program Files\Git\bin;%PATH%"
|
||||
echo "set PATH=C:\Program Files\Git\bin;%PATH% (for CMD prompt)"
|
||||
echo "\$env:Path = 'C:\Program Files\Git\bin;' + \$env:Path (for Powershell prompt)"
|
||||
exit 1
|
||||
fi
|
||||
if [[ "$(expr substr $OS_KERNEL 1 10)" == "MINGW64_NT" ]]; then
|
||||
|
Reference in New Issue
Block a user