From 68036b25ffbf70b98673ea0031ca389aa9083dd4 Mon Sep 17 00:00:00 2001 From: "user@node5.net" Date: Sun, 7 Jun 2026 19:57:22 +0200 Subject: git clone simplify setup --- src/blog_node5_net.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/blog_node5_net.py b/src/blog_node5_net.py index 5db8d7a..6509bc2 100644 --- a/src/blog_node5_net.py +++ b/src/blog_node5_net.py @@ -58,16 +58,11 @@ articles_repo_url = os.environ["ARTICLES_REPO_URL"] if "ARTICLES_REPO_URL" in os logger.debug(f'articles_path: {articles_path}') logger.debug(f'site_files_path: {site_files_path}') +# Clone repo, if folder empty pathlib.Path(articles_path).mkdir(parents=True, exist_ok=True) if pathlib.Path(articles_path).exists() and not any(pathlib.Path(articles_path).iterdir()): logger.info(f"Articles path {articles_path} is empty, cloning {articles_repo_url} into {articles_path}") - try: - subprocess.run(["git", "clone", articles_repo_url, articles_path], check=True, stderr=subprocess.PIPE, text=True) - except subprocess.CalledProcessError as e: - # Cleanup partially created files on failure - if path.exists() and not any(path.iterdir()): - shutil.rmtree(path, ignore_errors=True) - raise RuntimeError(f"git clone failed: {e.stderr.strip()}") from e + subprocess.run(["git", "clone", articles_repo_url, articles_path], check=True) article_generator = article.ArticleGenerator(articles_path) -- cgit v1.3.1