Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
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
etersoft
eepm
Commits
37292f11
Commit
37292f11
authored
Apr 10, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eget: add auto select for mode
parent
8f4b995b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
tools_eget
bin/tools_eget
+48
-0
No files found.
bin/tools_eget
View file @
37292f11
...
...
@@ -406,8 +406,56 @@ ipfs_check()
select_ipfs_mode
()
{
IPFS_CMD
=
"
$(
get_ipfs_brave
)
"
if
[
-n
"
$IPFS_CMD
"
]
;
then
IPFS_API
=
"
$ipfs_api_brave
"
if
ipfs_access
;
then
if
ipfs_check
"
$ipfs_checkQm
"
;
then
ipfs_mode
=
"brave"
&&
return
else
info
"Skipped Brave: it is accesible via
$IPFS_CMD
--api
$IPFS_API
, but can't return shared
$ipfs_checkQm
"
fi
fi
fi
IPFS_CMD
=
"
$(
print_command_path ipfs
)
"
if
[
-n
"
$IPFS_CMD
"
]
;
then
IPFS_API
=
"
$ipfs_api_local
"
if
ipfs_access
;
then
if
ipfs_check
"
$ipfs_checkQm
"
;
then
ipfs_mode
=
"local"
&&
return
else
info
"Skipped local: it is accesible via
$IPFS_CMD
--api
$IPFS_API
, but can't return shared
$ipfs_checkQm
"
fi
fi
fi
# TODO: check checksum
if
docmd eget
--check
"
$ipfs_gateway
/
$ipfs_checkQm
"
;
then
ipfs_mode
=
"gateway"
return
else
IPFS_GATEWAY
=
''
if
docmd eget
--check
"
$(
dirname
$ipfs_gateway
)
"
;
then
info
"IPFS gateway
$ipfs_gateway
is accessible, but can't return shared
$ipfs_checkQm
"
else
info
"IPFS gateway
$(
dirname
ipfs_gateway
)
is not accessible"
fi
fi
ipfs_mode
=
"disabled"
}
ipfs_mode
=
"
$EGET_IPFS
"
# detect if we run with ipfs:// or with auto
if
is_ipfsurl
"
$1
"
&&
[
-z
"
$ipfs_mode
"
]
||
[
"
$ipfs_mode
"
=
"auto"
]
||
[
-n
"
$EGET_IPFS_DB
"
]
;
then
select_ipfs_mode
info
"Auto selected IPFS mode:
$ipfs_mode
"
else
[
-n
"
$ipfs_mode
"
]
&&
info
"Use IPFS mode:
$ipfs_mode
"
fi
IPFS_CMD
=
''
if
[
"
$ipfs_mode
"
=
"disabled"
]
;
then
...
...
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