From 7ce22cee0e1e34d111f77257c0857702a4f7c2c1 Mon Sep 17 00:00:00 2001 From: Erica Marigold Date: Sat, 5 Aug 2023 19:45:30 +0530 Subject: [PATCH] feat(apt): shell script for updating lune binaries --- package/dpkg/deb/update_bins.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 package/dpkg/deb/update_bins.sh diff --git a/package/dpkg/deb/update_bins.sh b/package/dpkg/deb/update_bins.sh new file mode 100644 index 0000000..9549709 --- /dev/null +++ b/package/dpkg/deb/update_bins.sh @@ -0,0 +1,24 @@ +API_RESP=$(curl -s "https://api.github.com/repos/filiptibell/lune/releases/latest") + +for dir in ./*/ +do + dir=${dir%*/} + dir=${dir##*/} + + arch=$(echo $dir | cut -d '_' -f2) + + case $arch in + arm64) + arch="aarch64" + ;; + x86-64|amd64) + arch="x86_64" + ;; + esac + + dl_uri=$(grep -E "https.*lune-.*linux-$arch.zip" <<< $API_RESP | cut -d '"' -f4) + + wget $dl_uri -O $dir/usr/bin/lune +done + +find . -maxdepth 1 -mindepth 1 -type d -exec dpkg --build {} \;