summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrepo.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/repo.sh b/repo.sh
index dbddcce..36243a9 100755
--- a/repo.sh
+++ b/repo.sh
@@ -7,13 +7,13 @@
#REPO_NAME='repo_name'
## Search variables
-URL_PREFIX='https://aur.archlinux.org/rpc/?v=5&type=search&by=name-desc&arg='
-CLONE_PREFIX='https://aur.archlinux.org/'
+URL_PREFIX='https://aur.archlinux.org/'
+SEARCH_STR='rpc/?v=5&type=search&by=name-desc&arg='
add_package() {
if [ ! -d "${SRC_PATH}/$1" ]; then
cd ${SRC_PATH}
- git clone ${CLONE_PREFIX}$1.git
+ git clone ${URL_PREFIX}$1.git
else
echo 'WARNING: Package already present.'
fi
@@ -106,7 +106,7 @@ update_repo() {
search_packages() {
declare -a key=("${!1}")
- CURL_JSN=$(curl -s $(echo ${URL_PREFIX}"${key[@]}" | sed -e 's/ /+/g'))
+ CURL_JSN=$(curl -s $(echo ${URL_PREFIX}${SEARCH_STR}"${key[@]}" | sed -e 's/ /+/g'))
OUT_STR=$(jq -r '.results | .[] | [.Name, .Version], .Description' <<< ${CURL_JSN})
printf 'You searched using the following keywords (matching package name and/or description): "'
printf '%s ' "${key[@]}"