Commit 712b91d4 authored by Vitaly Lipatov's avatar Vitaly Lipatov

eget: replace dir_from_url() with path_from_url()

parent e18042a4
...@@ -166,7 +166,7 @@ is_fileurl() ...@@ -166,7 +166,7 @@ is_fileurl()
echo "$1" | grep -q "^file:/" echo "$1" | grep -q "^file:/"
} }
dir_from_url() path_from_url()
{ {
echo "$1" | sed -e 's|^file://*|/|' echo "$1" | sed -e 's|^file://*|/|'
} }
...@@ -337,7 +337,7 @@ if is_fileurl "$1" ; then ...@@ -337,7 +337,7 @@ if is_fileurl "$1" ; then
scat() scat()
{ {
local URL="$1" local URL="$1"
cat "$(dir_from_url "$URL")" cat "$(path_from_url "$URL")"
} }
# download to default name of to $2 # download to default name of to $2
sget() sget()
...@@ -347,16 +347,16 @@ sget() ...@@ -347,16 +347,16 @@ sget()
scat "$URL" scat "$URL"
return return
elif [ -n "$2" ] ; then elif [ -n "$2" ] ; then
cp -av "$(dir_from_url "$URL")" "$2" cp -av "$(path_from_url "$URL")" "$2"
return return
fi fi
cp -av "$(dir_from_url "$URL")" . cp -av "$(path_from_url "$URL")" .
} }
check_url_is_accessible() check_url_is_accessible()
{ {
local URL="$1" local URL="$1"
test -f "$(dir_from_url "$URL")" test -f "$(path_from_url "$URL")"
} }
elif [ -n "$WGET" ] ; then elif [ -n "$WGET" ] ; then
...@@ -493,7 +493,7 @@ make_fileurl() ...@@ -493,7 +493,7 @@ make_fileurl()
get_urls() get_urls()
{ {
if is_fileurl "$URL" ; then if is_fileurl "$URL" ; then
ls -1 "$(dir_from_url "$URL")" ls -1 "$(path_from_url "$URL")"
return return
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