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
f507b4f4
Commit
f507b4f4
authored
Apr 24, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm play: update IPFS DB every time (and merge with sort)
parent
d4e6832f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
7 deletions
+18
-7
epm-play
bin/epm-play
+18
-7
No files found.
bin/epm-play
View file @
f507b4f4
...
...
@@ -344,15 +344,26 @@ __epm_play_install()
__epm_play_initialize_ipfs
()
{
if
[
-d
"
$(
dirname
"
$epm_ipfs_db
"
)
"
]
;
then
export
EGET_IPFS_DB
=
"
$eget_ipfs_db
"
if
[
!
-r
"
$EGET_IPFS_DB
"
]
;
then
sudorun
touch
"
$EGET_IPFS_DB
"
>
&2
sudorun
chmod
-v
a+rw
"
$EGET_IPFS_DB
"
>
&2
local
URL
=
"https://eepm.ru/app-versions"
if
[
!
-r
"
$eget_ipfs_db
"
]
;
then
sudorun
touch
"
$eget_ipfs_db
"
>
&2
sudorun
chmod
-v
a+rw
"
$eget_ipfs_db
"
>
&2
# TODO: update this DB every time when changed (and get from IPFS as sign it works.)
# get initial db from server
local
URL
=
"https://eepm.ru/app-versions"
info
"Initialize IPFS DB in
$EGET_IPFS_DB
file and fill it with data from
$URL
/eget-ipfs-db.txt"
docmd eget
-q
-O
$EGET_IPFS_DB
"
$URL
/eget-ipfs-db.txt"
info
"Initialize local IPFS DB in
$eget_ipfs_db
file and fill it with data from
$URL
/eget-ipfs-db.txt"
docmd eget
-q
-O
$eget_ipfs_db
"
$URL
/eget-ipfs-db.txt"
else
# update
local
t
=
$(
mktemp
)
||
fatal
info
"Updating local IPFS DB in
$eget_ipfs_db
file from
$URL
/eget-ipfs-db.txt"
docmd eget
-q
-O
$t
"
$URL
/eget-ipfs-db.txt"
||
warning
"Can't update IPFS DB"
if
[
-s
"
$t
"
]
;
then
echo
>>
$t
cat
$eget_ipfs_db
>>
$t
sort
-u
<
$t
|
grep
-v
"^$"
>
$eget_ipfs_db
fi
fi
export
EGET_IPFS_DB
=
"
$eget_ipfs_db
"
else
warning
"ipfs db dir
$eget_ipfs_db
is not exists, skipping --ipfs"
fi
...
...
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