summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-07-13 15:15:00 +0200
committerErich Eckner <git@eckner.net>2018-07-13 15:15:00 +0200
commit550ec57c321aca0b664afc41ba453fcbcbe156e9 (patch)
treef0966f11bf1dbf7d671b73f3df19ee016d0236ee
parent56791c1b1cee584c26fb6b68537e8b5143774753 (diff)
downloadbuff-di-wuff-550ec57c321aca0b664afc41ba453fcbcbe156e9.tar.xz
buff-di-wuff: correct prefix
-rwxr-xr-xbuff-di-wuff5
1 files changed, 4 insertions, 1 deletions
diff --git a/buff-di-wuff b/buff-di-wuff
index c86965f..7cbe7cc 100755
--- a/buff-di-wuff
+++ b/buff-di-wuff
@@ -20,6 +20,9 @@ grep '^[^#]' "$(dirname "$0")/downloads.list" | \
printf '%s\n' "${url}" | \
sed 's|/[^/]*$|/|'
)
+ urlPrefix="${urlDir}"
+ else
+ urlPrefix="${url%/*}/"
fi
urlFile=$(
printf '%s\n' "${url}" | \
@@ -33,7 +36,7 @@ grep '^[^#]' "$(dirname "$0")/downloads.list" | \
tr '"<>/' '\n' | \
grep "^${urlFile}\$" | \
sort -u | \
- xargs -r printf "${urlDir}%s\n"
+ xargs -r printf "${urlPrefix}%s\n"
else
printf '%s\n' "${url}"
fi