From eb1c3be73af61351511b5074ba597db29ac94acd Mon Sep 17 00:00:00 2001 From: pvincent Date: Wed, 6 Mar 2024 21:44:31 +0400 Subject: [PATCH] remove dependency to wget --- README.md | 2 +- install.sh | 2 +- tools/wget_release | 22 ++++++++++------------ 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index dcb4ffb..e6cd96a 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ It's Free Software (AGPLv3), help yourself. Any feedback would be appreciated. [contact@artcode.re](mailto:contact@artcode.re) ## install -`curl https://git.artcode.re/miaou/miaou-bash/raw/branch/main/install.sh | sudo bash -s -- --host` +`curl https://git.artcode.re/miaou/miaou-bash/raw/branch/main/install.sh | sudo bash -s` ## upgrade `upgrade-miaou-bash` diff --git a/install.sh b/install.sh index 43e831b..1a1605b 100755 --- a/install.sh +++ b/install.sh @@ -33,7 +33,7 @@ if [[ $CURDIR != '/opt/miaou-bash' ]]; then rm -rf /opt/miaou-bash push_directory "$(mktemp -d)" - wget $MAIN_TAR_GZ_URL + curl --no-progress-meter -O $MAIN_TAR_GZ_URL tar -xzf main.tar.gz mv miaou-bash /opt/ pop_directory diff --git a/tools/wget_release b/tools/wget_release index 5784298..51a02e0 100755 --- a/tools/wget_release +++ b/tools/wget_release @@ -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 - -