From 8bf5faa82bcece56f7f62b09a52725252a455db4 Mon Sep 17 00:00:00 2001 From: pvincent Date: Wed, 19 Aug 2026 11:46:12 +0400 Subject: [PATCH] latest_tag --- install.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/install.sh b/install.sh index 3c5455c..031cd7f 100755 --- a/install.sh +++ b/install.sh @@ -1,11 +1,8 @@ #!/usr/bin/env bash -## CONSTANTS -#TODO: LATEST_TAG -# LATEST_TAG=$(curl -s https://git.artcode.re/api/v1/repos/miaou/miaou-bash/tags|grep -oPm1 '{"name":".*?",' | head -n1 | cut -d'"' -f4) -# https://git.artcode.re/miaou/miaou-bash/archive/0.3.109.tar.gz +## CONSTANTS -MAIN_TAR_GZ_URL="https://git.artcode.re/miaou/miaou-bash/archive/main.tar.gz" +BASE_URL='https://git.artcode.re/miaou/miaou-bash/archive' ## FUNCTIONS @@ -16,10 +13,16 @@ function upgrade { function install { echo INSTALL + local latest_tag + latest_tag=$(curl -s https://git.artcode.re/api/v1/repos/miaou/miaou-bash/tags | + grep -oPm1 '{"name":".*?",' | + head -n1 | + cut -d'"' -f4) + + echo "latest_tag=$latest_tag" - local tempfile - tempfile="/tmp/$(basename "$MAIN_TAR_GZ_URL")" - curl -so "$tempfile" $MAIN_TAR_GZ_URL + local tempfile='/tmp/miaou-bash-latest.tar.gz' + curl -so "$tempfile" "${BASE_URL}/${latest_tag}.tar.gz" sudo tar -xzf "$tempfile" --directory "$(dirname "$MIAOU_BASH_DIR")" rm "$tempfile" execute_miaou_lib initiate @@ -62,7 +65,7 @@ if [[ ! -v MIAOU_BASH_DIR ]]; then export MIAOU_BASH_DIR fi -deployment_type_adjective="${1:-installed}" # self-upgrade provides 'upgrade' +deployment_type_adjective="${1:-installed}" # `miaou-bash --self-upgrade` provides the 'upgrade' term if once_installed; then upgrade; else install; fi if [[ $deployment_type_adjective == 'installed' ]]; then exec bash -l