This repository has been archived on 2024-05-06. You can view files and clone it, but cannot push or open issues or pull requests.
package/check_package_exists.sh

10 lines
299 B
Bash
Raw Normal View History

#!/usr/bin/sh
arch=$(grep "CARCH" /etc/makepkg.conf | grep -Po 'CARCH="\K[^"]*')
http_status=$(curl -sLI https://serguzim.me/repo/archlinux/$arch/emgauwa/$(basename $(makepkg --packagelist)) | head -n 1)
http_code=$(echo $http_status | awk '{ print $2 }')
[ $http_code -eq 200 ] && exit 0
exit 1