Commit 2814c50c authored by Vitaly Lipatov's avatar Vitaly Lipatov

tools_eget: fix direct download from github

parent e31a3515
...@@ -150,7 +150,16 @@ get_github_urls() ...@@ -150,7 +150,16 @@ get_github_urls()
grep -i -o -E '"browser_download_url": "https://.*"' | cut -d'"' -f4 grep -i -o -E '"browser_download_url": "https://.*"' | cut -d'"' -f4
} }
if echo "$1" | grep -q "^https://github.com/" ; then # mask allowed only in the last part of path
MASK=$(basename "$1")
NOMASK=''
# If have no wildcard symbol like asterisk, just download
if echo "$MASK" | grep -qv "[*?]" || echo "$MASK" | grep -q "[?].*="; then
NOMASK='1'
fi
if echo "$1" | grep -q "^https://github.com/" && ! echo "$1" | grep -q "/releases/download/" ; then
MASK="$2" MASK="$2"
if [ -n "$LISTONLY" ] ; then if [ -n "$LISTONLY" ] ; then
...@@ -184,11 +193,8 @@ if echo "$URL" | grep -q "[*?]" ; then ...@@ -184,11 +193,8 @@ if echo "$URL" | grep -q "[*?]" ; then
fatal "Error: there are globbing symbols (*?) in $URL" fatal "Error: there are globbing symbols (*?) in $URL"
fi fi
# mask allowed only in the last part of path
MASK=$(basename "$1")
# If have no wildcard symbol like asterisk, just download # If have no wildcard symbol like asterisk, just download
if echo "$MASK" | grep -qv "[*?]" || echo "$MASK" | grep -q "[?].*="; then if [ -n "$NOMASK" ] ; then
sget "$1" "$TARGETFILE" sget "$1" "$TARGETFILE"
exit exit
fi 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