3 script_path="$( cd -P "$( dirname "$(readlink -f "$0")" )" && pwd )"
7 for DIR in $(find "${script_path}" -type f -name "PKGBUILD" | xargs realpath | xargs dirname); do
8 PACKAGE="$(basename "${DIR}")"
10 if [[ "${PACKAGE}" = "filesystem" ]]; then
14 if [[ ! "$(curl -sL "https://www.archlinux.org/packages/search/json/?name=${PACKAGE}" | jq .results)" = "[]" ]]; then
19 asp export "${PACKAGE}"
22 mkdir -p "${script_path}/temp/${PACKAGE}"
23 git clone "https://aur.archlinux.org/${PACKAGE}.git" "${script_path}/temp/${PACKAGE}"
24 if [[ -n "$(ls "${script_path}/temp/${PACKAGE}")" ]]; then
26 mv "${script_path}/temp/${PACKAGE}" "${DIR}"