From b1de3823a35e40c26fb863da2ecda3aa334b7ce8 Mon Sep 17 00:00:00 2001 From: Akash Manohar J Date: Thu, 30 Jun 2016 11:14:50 +0530 Subject: [PATCH] Add get_source_compile_path to return dir for keeping source --- lib/utils.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/utils.sh b/lib/utils.sh index 3c29b9c7..2695f13a 100644 --- a/lib/utils.sh +++ b/lib/utils.sh @@ -28,6 +28,21 @@ get_install_path() { } +get_source_compile_path() { + local plugin=$1 + local install_type=$2 + local version=$3 + mkdir -p $(asdf_dir)/sources/${plugin} + + if [ $install_type = "version" ] + then + echo $(asdf_dir)/sources/${plugin}/${version} + else + echo $(asdf_dir)/sources/${plugin}/${install_type}-${version} + fi +} + + check_if_plugin_exists() { if [ ! -d $1 ] then @@ -36,6 +51,7 @@ check_if_plugin_exists() { fi } + check_if_version_exists() { local plugin=$1 local version=$2