diff --git a/bin/install b/bin/install index 14fd68a..ea42568 100755 --- a/bin/install +++ b/bin/install @@ -29,15 +29,18 @@ install_kubeseal() { echo "Cleaning previous binaries" rm -f $binary_path 2>/dev/null || true - echo "Copying binary" - cp "${tmp_download_dir}/kubeseal-${platform}" ${binary_path} + echo "Unpacking and copying binary" + tar xz -C ${bin_install_path} -f $download_path kubeseal chmod +x ${binary_path} + + echo "Cleaning up temp files" + rm -rf $tmp_download_dir } get_filename() { local platform="$2" - echo "kubeseal-${platform}" + echo "kubeseal-${version}-${platform}.tar.gz" } get_download_url() { diff --git a/bin/list-all b/bin/list-all index 992c6ed..68feb9e 100755 --- a/bin/list-all +++ b/bin/list-all @@ -7,12 +7,6 @@ if [ -n "$GITHUB_API_TOKEN" ]; then fi cmd="$cmd $releases_path" -# stolen from https://github.com/rbenv/ruby-build/pull/631/files#diff-fdcfb8a18714b33b07529b7d02b54f1dR942 -function sort_versions() { - sed 'h; s/[+-]/./g; s/.p\([[:digit:]]\)/.z\1/; s/$/.z/; G; s/\n/ /' | \ - LC_ALL=C sort -t. -k 1,1 -k 2,2n -k 3,3n -k 4,4n -k 5,5n | awk '{print $2}' -} - # Fetch all tag names, and get only second column. Then remove all unnecesary characters. -versions=$(eval $cmd | grep -oE "tag_name\": *\".{1,15}\"," | sed 's/tag_name\": *\"v//;s/\",//' | sort_versions) +versions=$(eval $cmd | grep 'tag_name":' | sed -e 's/^ *"tag_name": "//' | grep -v ^helm- | grep -v ^sealed | sed -e 's/^v//;s/", *$//' | sort -V) echo $versions