From e3ada52ca469e99c3063c549ea1c69e6456dd149 Mon Sep 17 00:00:00 2001 From: Jeremy Fleischman Date: Tue, 22 Mar 2022 14:28:22 -0700 Subject: [PATCH] Don't complain if a patch file doesn't exist for a particular version of python I hope this isn't too controversial: I personally have this `ASDF_PYTHON_PATCHES_DIRECTORY` globally set up on my machine, which is super useful when I install/reinstall random versions of Python, but is kind of annoying when I try to install versions of python that don't actually need a patch: I have to create an empty file just to get it to install. With this change, I don't have to do that: instead I only have to create `.patch` files for the versions of Python that need it. --- bin/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/install b/bin/install index 51fe2ed..a6bc068 100755 --- a/bin/install +++ b/bin/install @@ -20,7 +20,7 @@ install_python() { echo "python-build --patch $version $install_path" echo "with patch file from: $ASDF_PYTHON_PATCH_URL" $(python_build_path) --patch "$version" "$install_path" < <(curl -sSL "$ASDF_PYTHON_PATCH_URL") - elif [[ -n "${ASDF_PYTHON_PATCHES_DIRECTORY:-}" ]]; then + elif [[ -n "${ASDF_PYTHON_PATCHES_DIRECTORY:-}" ]] && [[ -f ${ASDF_PYTHON_PATCHES_DIRECTORY}/${version}.patch ]]; then local patch_file=${ASDF_PYTHON_PATCHES_DIRECTORY}/${version}.patch echo "python-build $version $install_path -p < $patch_file" $(python_build_path) "$version" "$install_path" -p < $patch_file