refactor: install script
Refactor install script to use 1 liner during latest version install
@@ -146,14 +146,13 @@ download() {
if [ "$2" ]; then
_version="$2"
_url="$_download_base_url/ockam_$_version/$_binary_file_name"
- else
- _url=$(curl --proto '=https' --tlsv1.2 --silent --fail --show-error "$_api")
- _url=$(echo "$_url" | grep -i browser_download_url | grep "$_binary_file_name" | head -1 | awk '{print $NF}')
- _url=$(echo "$_url" | sed -e 's/^"//' -e 's/"$//') # remove quotes
- _version=$(echo "$_url" | awk -F'/' '{print $(NF-1)}' | cut -d '_' -f2) # change "ockam_v0.75.0" to "v0.75.0"
- fi
info "Installing $_version"
+ else
+ _url="https://github.com/build-trust/ockam/releases/latest/download/$_binary_file_name"
+
+ info "Installing latest version"
+ fi
info "Dowloading $_url"
curl --proto '=https' --tlsv1.2 --location --silent --fail --show-error --output "ockam" "$_url"
