|
|
@ -20,24 +20,22 @@ function usage { |
|
|
|
|
|
|
|
function get_github { |
|
|
|
local BASE="https://github.com" |
|
|
|
local release=$( wget_semver $REPO_TYPE $REPO_NAME ) |
|
|
|
local release=$(wget_semver $REPO_TYPE $REPO_NAME) |
|
|
|
local url="$BASE/${REPO_NAME}/archive/refs/tags/${release}.tar.gz" |
|
|
|
if [[ -d $DESTINATION ]]; then |
|
|
|
DESTINATION="$DESTINATION/$(echo $REPO_NAME | cut -d '/' -f2 )-${release}.tgz" |
|
|
|
DESTINATION="$DESTINATION/$(echo $REPO_NAME | cut -d '/' -f2)-${release}.tgz" |
|
|
|
fi |
|
|
|
>&2 wget $url -O $DESTINATION |
|
|
|
echo $DESTINATION |
|
|
|
curl >&2 --no-progress-meter $url -o $DESTINATION |
|
|
|
echo "$DESTINATION" |
|
|
|
} |
|
|
|
|
|
|
|
[[ $# -lt 2 ]] && usage |
|
|
|
|
|
|
|
case $REPO_TYPE in |
|
|
|
github ) |
|
|
|
get_github |
|
|
|
;; |
|
|
|
* ) |
|
|
|
echo "repository type <${REPO_TYPE}> not yet supported!" && exit 1 |
|
|
|
;; |
|
|
|
github) |
|
|
|
get_github |
|
|
|
;; |
|
|
|
*) |
|
|
|
echo "repository type <${REPO_TYPE}> not yet supported!" && exit 1 |
|
|
|
;; |
|
|
|
esac |
|
|
|
|
|
|
|
|