Commit 1e314ded authored by Vitaly Lipatov's avatar Vitaly Lipatov

eget: allow separated mask for urls

parent fe3b65e5
......@@ -184,15 +184,22 @@ if echo "$1" | grep -q "^ftp://" ; then
exit
fi
# drop mask part
URL="$(dirname "$1")/"
# mask allowed only in the last part of path
MASK=$(basename "$1")
# if mask are second arg
if [ -n "$2" ] ; then
URL="$1"
MASK="$2"
else
# drop mask part
URL="$(dirname "$1")"
fi
if echo "$URL" | grep -q "[*?]" ; then
fatal "Error: there are globbing symbols (*?) in $URL"
fi
# mask allowed only in the last part of path
MASK=$(basename "$1")
# If have no wildcard symbol like asterisk, just download
if echo "$MASK" | grep -qv "[*?]" || echo "$MASK" | grep -q "[?].*="; then
......@@ -216,7 +223,7 @@ fi
ERROR=0
for fn in $(get_urls | filter_glob "$MASK" | filter_order) ; do
sget "$URL$(basename "$fn")" || ERROR=1
sget "$URL/$(basename "$fn")" || ERROR=1
done
exit $ERROR
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