From 005a2a3bb3dbaac6a15a6ebdce10c9997ff32193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20P=C5=82ocki?= Date: Mon, 27 May 2024 20:00:36 +0200 Subject: [PATCH] Expand the marker file path --- podcast_downloader/__main__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/podcast_downloader/__main__.py b/podcast_downloader/__main__.py index e8594ff..43cd5ae 100644 --- a/podcast_downloader/__main__.py +++ b/podcast_downloader/__main__.py @@ -170,7 +170,8 @@ def load_the_last_run_date_store_now(marker_file_path, now): if marker_file_path == None: return None - if not os.path.exists(marker_file_path): + full_marker_file_path = os.path.expanduser(marker_file_path) + if not os.path.exists(full_marker_file_path): logger.warning("Marker file doesn't exist, creating (set last time run as now)") with open(marker_file_path, "w") as file: @@ -180,14 +181,13 @@ def load_the_last_run_date_store_now(marker_file_path, now): return now - access_time = time.localtime(os.path.getatime(marker_file_path)) - + access_time = time.localtime(os.path.getatime(full_marker_file_path)) logger.info( "Last time the script has been run: %s", time.strftime("%Y-%m-%d %H:%M:%S", access_time), ) - os.utime(marker_file_path, times=(time.mktime(now), time.mktime(now))) + os.utime(full_marker_file_path, times=(time.mktime(now), time.mktime(now))) return access_time