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
fc71126a
Commit
fc71126a
authored
Apr 12, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eget: add filename support in
ipfs://Qm...filename=real.name
parent
416b9e63
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
eget
eget
+16
-1
No files found.
eget
View file @
fc71126a
...
...
@@ -240,7 +240,7 @@ is_httpurl()
cid_from_url
()
{
echo
"
$1
"
|
sed
-e
's|^ipfs://*||'
echo
"
$1
"
|
sed
-e
's|^ipfs://*||'
-e
's|\?.*||'
}
...
...
@@ -776,6 +776,13 @@ url_sget()
ipfs_get
"
$(
cid_from_url
"
$URL
"
)
"
"
$2
"
return
fi
local
fn
=
"
$(
url_print_filename_from_url
"
$URL
"
)
"
if
[
-n
"
$fn
"
]
;
then
ipfs_get
"
$(
cid_from_url
"
$URL
"
)
"
"
$fn
"
return
fi
ipfs_get
"
$(
cid_from_url
"
$URL
"
)
"
}
...
...
@@ -786,9 +793,17 @@ url_check()
scat
"
$URL
"
>
/dev/null
}
url_print_filename_from_url
()
{
local
URL
=
"
$1
"
local
fn
=
"
$(
echo
"
$URL
"
|
sed
-e
's|ipfs://.*\?filename=||'
)
"
[
"
$URL
"
!=
"
$fn
"
]
&&
echo
"
$fn
"
&&
return
}
url_get_filename
()
{
local
URL
=
"
$1
"
url_print_filename_from_url
"
$URL
"
&&
return
local
CID
=
"
$(
cid_from_url
"
$URL
"
)
"
get_filename_by_cid
"
$CID
"
}
...
...
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