Commit 67f65f78 authored by Vitaly Lipatov's avatar Vitaly Lipatov

eget: concatenate filenames with base url if need

parent 1e314ded
......@@ -200,23 +200,28 @@ if echo "$URL" | grep -q "[*?]" ; then
fatal "Error: there are globbing symbols (*?) in $URL"
fi
# If have no wildcard symbol like asterisk, just download
if echo "$MASK" | grep -qv "[*?]" || echo "$MASK" | grep -q "[?].*="; then
sget "$1" "$TARGETFILE"
exit
fi
is_url()
{
echo "$1" | grep -q "://"
}
get_urls()
{
scat $URL | \
grep -i -o -E 'href="([^\*/"#]+)"' | cut -d'"' -f2
grep -i -o -E 'href="(.+)"' | cut -d'"' -f2
}
if [ -n "$LISTONLY" ] ; then
for fn in $(get_urls | filter_glob "$MASK" | filter_order) ; do
# TODO: return full url? someone use old behaviour?
echo "$URL$(basename "$fn")"
is_url "$fn" && echo $fn && continue
fn="$(echo "$fn" | sed -e 's|^./||' -e 's|^/+||')"
echo "$URL/$fn"
done
exit
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment