refactor(flash_klipper.sh): select python version of klippy-env

Signed-off-by: Dominik Willner th33xitus@gmail.com
This commit is contained in:
th33xitus
2022-05-14 12:22:37 +02:00
parent b06442af4c
commit 40e62a7645
2 changed files with 32 additions and 16 deletions

View File

@@ -511,4 +511,11 @@ function get_klipper_cfg_dir() {
cfg_dir="${custom_klipper_cfg_loc}"
fi
echo "${cfg_dir}"
}
### returns the major python version the klippy-env was created with
function get_klipper_python_ver() {
local version
version=$("${KLIPPY_ENV}"/bin/python --version 2>&1 | cut -d" " -f2 | cut -d"." -f1)
echo "${version}"
}