diff --git a/src/bee-download.sh.in b/src/bee-download.sh.in index 271e060..b4345ad 100644 --- a/src/bee-download.sh.in +++ b/src/bee-download.sh.in @@ -50,11 +50,20 @@ function usage() { EOF } +function guess_type() { + repository_url=${1} + + [ "${repository_url##*.}" = "git" ] && echo "git" && return + [ -d "${repository_url}/.git" ] && echo "git" && return + + echo ${repository_url%%:*} +} + function download() { repository_url=${1} repository_type=${2} - : ${repository_type:=${repository_url%%:*}} + : ${repository_type:=$(guess_type ${repository_url})} case "${repository_type}" in http|https)