Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
IPFS Pinning Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
F-Droid
IPFS Pinning Server
Commits
dc0d6429
Commit
dc0d6429
authored
1 year ago
by
thefuture
Browse files
Options
Downloads
Patches
Plain Diff
Added complete path to ensure no erros pop up
parent
298bdc49
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
download_new_and_updated_apps_to_folder.py
+6
-4
6 additions, 4 deletions
download_new_and_updated_apps_to_folder.py
with
6 additions
and
4 deletions
download_new_and_updated_apps_to_folder.py
+
6
−
4
View file @
dc0d6429
...
...
@@ -164,16 +164,17 @@ def pin_apks_to_ipfs(app, fdroid_path, path_to_current_index):
def
get_current_index_v2_json
():
"""
Gets current index-v2 from f-droid.org
"""
index_v2_url
=
"
https://f-droid.org/repo/index-v2.json
"
path_to_cron_folder
=
get_path_to_pining_folder
()
todays_date
=
str
(
datetime
.
date
(
datetime
.
now
()))
complete_command
=
"
wget
--tries=5
--quiet -O index-v2-
"
+
todays_date
+
"
.json
"
+
index_v2_url
complete_command
=
f
"
wget --quiet -O
{
path_to_cron_folder
}
index-v2-
{
todays_date
}
.json
{
index_v2_url
}
"
print
(
"
Fetching index-v2.json from f-droid.org
"
)
fetch_index
=
subprocess
.
run
(
shlex
.
split
(
complete_command
))
if
fetch_index
.
returncode
!=
0
:
file_name
=
"
index-v2-
"
+
todays_date
+
"
.json
"
file_name
=
f
"
{
path_to_cron_folder
}
index-v2-
{
todays_date
}
.json
"
os
.
remove
(
file_name
)
logging
.
warn
in
g
(
"
wget cannot fetch index-v2.json
"
)
pr
in
t
(
"
wget cannot fetch index-v2.json
"
)
sys
.
exit
()
...
...
@@ -200,6 +201,7 @@ def get_any_index_v2_json(any_date, file_path):
def
check_git_repo_for_any_commits
():
"""
Checks index v2 git repo for any commits
"""
index_v2_git_location
=
get_path_to_pining_folder
()
+
'
index_v2_git_repo
'
#index_v2_git_location = 'index_v2_git_repo'
repo
=
git
.
Repo
(
index_v2_git_location
)
commit_list
=
repo
.
head
.
reference
.
log
()
todays_date
=
str
(
datetime
.
date
(
datetime
.
now
()))
...
...
@@ -233,7 +235,7 @@ def check_git_repo_for_any_commits():
repo
.
index
.
add
([
latest_index_json
])
commit_meesage
=
f
"
F-Droid Index-V2-json as per
{
todays_date
}
"
repo
.
index
.
commit
(
commit_meesage
)
print
(
"
No diff generated, this is the first time you are running
TWIF
with Index-v2.json
"
)
print
(
"
No diff generated, this is the first time you are running
this scipt
with Index-v2.json
"
)
def
notify_user_of_run
():
"""
This is used for testing
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment