diff options
author | Seppia <seppia@seppia.net> | 2018-06-02 12:49:33 +0200 |
---|---|---|
committer | Seppia <seppia@seppia.net> | 2018-06-02 12:49:33 +0200 |
commit | 19d76f4e6f685c542e475a55f0b9187b151e35d0 (patch) | |
tree | a20a2e2fe66c101b580ae804861854b0bc746a27 | |
parent | 23e9d01f0c83ae18faaab23eabc4d4ba18611146 (diff) | |
download | repofish-19d76f4e6f685c542e475a55f0b9187b151e35d0.tar.gz repofish-19d76f4e6f685c542e475a55f0b9187b151e35d0.tar.bz2 repofish-19d76f4e6f685c542e475a55f0b9187b151e35d0.zip |
URL variables fixv0.1
Used url variables in a more convenient way.
-rwxr-xr-x | repo.sh | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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[@]}" |