From 97c75a6c5342a92ab49fb8e22c67c4023a79f7c4 Mon Sep 17 00:00:00 2001 From: Joey Espinosa Date: Mon, 1 Feb 2021 23:29:28 -0500 Subject: [PATCH] refactor: combine multiple sed statements --- bin/download | 2 +- bin/list-all | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/download b/bin/download index 7b9c9b9..b652cd1 100755 --- a/bin/download +++ b/bin/download @@ -26,7 +26,7 @@ download() { local -r download_url="$(get_download_url $filename)" echo "Downloading ${toolname} version ${ASDF_INSTALL_VERSION} from ${download_url}" - if $CURL -fL "${download_url}" -o "${ASDF_DOWNLOAD_PATH}/${filename}" + if $CURL -fsL "${download_url}" -o "${ASDF_DOWNLOAD_PATH}/${filename}" then echo "Successfully downloaded ${filename}" exit 0 diff --git a/bin/list-all b/bin/list-all index 9dc4954..f55a264 100755 --- a/bin/list-all +++ b/bin/list-all @@ -17,5 +17,5 @@ function sort_versions() { LC_ALL=C sort -t. -k 1,1 -k 2,2n -k 3,3n } -versions=$($CURL -fL "https://api.github.com/repos/$repository/releases" | grep tag_name | sed -e 's/"tag_name": //g;s/"//g;s/,//g' -e 's/v//g' -e '/1.6.0/q') +versions=$($CURL -fsL "https://api.github.com/repos/$repository/releases" | grep tag_name | sed 's/"tag_name": //g;s/"//g;s/,//g;s/v//g;/1.6.0/q') echo "$versions" | sort_versions | xargs