Commit ab9e1f0c authored by Vitaly Lipatov's avatar Vitaly Lipatov

EGET_BACKEND: add support for abs path to the command

parent 9b27adf5
...@@ -902,6 +902,8 @@ WGET="$(print_command_path wget)" ...@@ -902,6 +902,8 @@ WGET="$(print_command_path wget)"
CURL="$(print_command_path curl)" CURL="$(print_command_path curl)"
ORIG_EGET_BACKEND="$EGET_BACKEND" ORIG_EGET_BACKEND="$EGET_BACKEND"
EGET_BACKEND="$(basename "$EGET_BACKEND")"
# override backend # override backend
if is_fileurl "$1" ; then if is_fileurl "$1" ; then
EGET_BACKEND="file" EGET_BACKEND="file"
...@@ -909,13 +911,20 @@ elif is_ipfsurl "$1" ; then ...@@ -909,13 +911,20 @@ elif is_ipfsurl "$1" ; then
EGET_BACKEND="ipfs" EGET_BACKEND="ipfs"
fi fi
case "$ORIG_EGET_BACKEND" in
case "$EGET_BACKEND" in
file|ipfs) file|ipfs)
;; ;;
*/wget)
WGET="$ORIG_EGET_BACKEND"
[ -x "$WGET" ] || fatal "There are no $ORIG_EGET_BACKEND in the system but you forced using it via EGET_BACKEND. Install it with $ epm install wget"
;;
wget) wget)
[ -n "$WGET" ] || fatal "There are no wget in the system but you forced using it via EGET_BACKEND. Install it with $ epm install wget" [ -n "$WGET" ] || fatal "There are no wget in the system but you forced using it via EGET_BACKEND. Install it with $ epm install wget"
;; ;;
*/curl)
CURL="$ORIG_EGET_BACKEND"
[ -x "$CURL" ] || fatal "There are no $ORIG_EGET_BACKEND in the system but you forced using it via EGET_BACKEND. Install it with $ epm install curl"
;;
curl) curl)
[ -n "$CURL" ] || fatal "There are no curl in the system but you forced using it via EGET_BACKEND. Install it with $ epm install curl" [ -n "$CURL" ] || fatal "There are no curl in the system but you forced using it via EGET_BACKEND. Install it with $ epm install curl"
;; ;;
......
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