Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
eget
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Ivlev
eget
Commits
c47060c3
Commit
c47060c3
authored
Mar 29, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eget: make correct URL if file part parsed by mask separately
parent
c0b4c79b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
eget
eget
+12
-2
No files found.
eget
View file @
c47060c3
...
...
@@ -449,7 +449,7 @@ if [ -n "$2" ] ; then
MASK
=
"
$2
"
else
# drop mask part
URL
=
"
$(
dirname
"
$1
"
)
"
URL
=
"
$(
dirname
"
$1
"
)
/
"
fi
if
[
-z
"
$MASK
"
]
&&
echo
"
$URL
"
|
grep
-q
"[*?]"
;
then
...
...
@@ -477,16 +477,26 @@ make_fileurl()
{
local
url
=
"
$1
"
local
fn
=
"
$2
"
fn
=
"
$(
echo
"
$fn
"
|
sed
-e
's|^./||'
-e
's|^/+||'
)
"
if
is_fileurl
"
$url
"
;
then
echo
"
$url
/
$fn
"
return
fi
# if there is file path from the root of the site
if
echo
"
$fn
"
|
grep
-q
"^/"
;
then
echo
"
$(
get_host_only
"
$url
"
)
$fn
"
return
fi
# if there is no slash in the end of URL
if
echo
"
$url
"
|
grep
-q
-v
"/$"
;
then
echo
"
$(
dirname
"
$url
"
|
sed
-e
's|/*$||'
)
/
$fn
"
return
fi
# workaround for a slash in the end of URL
echo
"
$(
echo
"
$url
"
|
sed
-e
's|/*$||'
)
/
$fn
"
}
...
...
@@ -513,7 +523,7 @@ fi
ERROR
=
0
for
fn
in
$(
get_urls | filter_glob
"
$MASK
"
| filter_order
)
;
do
is_url
"
$fn
"
||
fn
=
"
$(
make_fileurl
"
$URL
"
"
$
(
basename
"
$fn
"
)
"
)
"
#"
is_url
"
$fn
"
||
fn
=
"
$(
make_fileurl
"
$URL
"
"
$
fn
"
)
"
#"
sget
"
$fn
"
"
$TARGETFILE
"
||
ERROR
=
1
[
-n
"
$TARGETFILE
"
]
&&
[
"
$ERROR
"
=
"0"
]
&&
break
done
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment