Skip to content
Snippets Groups Projects
Commit dc0d6429 authored by thefuture's avatar thefuture
Browse files

Added complete path to ensure no erros pop up

parent 298bdc49
No related branches found
No related tags found
No related merge requests found
......@@ -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.warning("wget cannot fetch index-v2.json")
print("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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment