Use installs/<package>/<version> as installation dir

This commit is contained in:
Akash Manohar J 2014-11-30 15:25:26 +05:30
parent 7b9f905870
commit 1df29d6913
2 changed files with 4 additions and 17 deletions

View File

@ -29,25 +29,17 @@ install_command() {
local version="${version_info[0]}" local version="${version_info[0]}"
fi fi
local install_path=$(get_install_path $package $version) local install_path=$(get_install_path $package $full_version)
${source_path}/install $install_type $version $install_path "${@:3}" ${source_path}/install $install_type $version $install_path "${@:3}"
if [ $? -e 0 ]
then
echo "$version $(basename $install_path)" >> $(dirname $install_path)/.versions
#TODO create shims for new version
else
exit 1
fi
} }
get_install_path() { get_install_path() {
local package=$1 local package=$1
local versio=$2 local version=$2
mkdir -p $(asdf_dir)/installs/$package mkdir -p $(asdf_dir)/installs/${package}
echo $(asdf_dir)/installs/$package/$(generate_random_hash) echo $(asdf_dir)/installs/${package}/${version}
} }

View File

@ -13,11 +13,6 @@ asdf_dir() {
} }
generate_random_hash() {
openssl rand -hex 4
}
run_callback_if_command() { run_callback_if_command() {
if [ "$1" = "$2" ] if [ "$1" = "$2" ]
then then