This repository has been archived on 2024-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
asdf-python/shims/python
2017-03-27 08:55:57 -07:00

24 lines
621 B
Bash
Executable file

#!/usr/bin/env bash
source $(dirname $(dirname $0))/lib/utils.sh
run_python() {
local plugin_name="python"
local full_version=$(get_preset_version_for $plugin_name)
if [ "$full_version" == "" ]; then
echo "No version set for ${plugin_name}"
exit -1
fi
local short_python_version=""
if [ "$full_version" != "system" ]; then
IFS='.' read -r -a splitted_version <<< "$full_version"
short_python_version="${splitted_version[0]}.${splitted_version[1]}"
fi
exec $(asdf_dir)/bin/private/asdf-exec python bin/python${short_python_version} "$@"
}
run_python "$@"