summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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