asdf/lib/commands/install.sh

20 lines
653 B
Bash
Raw Normal View History

2015-05-17 01:49:28 -07:00
install_command() {
2015-05-17 00:46:56 -07:00
local package_name=$1
local full_version=$2
2015-05-17 11:20:51 -07:00
local plugin_path=$(get_plugin_path $package_name)
check_if_plugin_exists $plugin_path
2015-05-07 22:58:07 -07:00
2015-05-17 00:46:56 -07:00
IFS=':' read -a version_info <<< "$full_version"
2015-05-17 03:47:45 -07:00
if [ "${version_info[0]}" = "tag" ] || [ "${version_info[0]}" = "commit" ]; then
2015-05-17 00:46:56 -07:00
local install_type="${version_info[0]}"
local version="${version_info[1]}"
else
local install_type="version"
local version="${version_info[0]}"
fi
2015-05-07 22:58:07 -07:00
2015-05-17 00:46:56 -07:00
local install_path=$(get_install_path $package_name $install_type $version)
2015-05-17 11:20:51 -07:00
${plugin_path}/bin/install $install_type $version $install_path
2015-05-17 06:32:47 -07:00
reshim_command $package_name $full_version
2015-05-17 00:46:56 -07:00
}