aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoruser@node5.net <user@node5.net>2026-05-31 15:14:06 +0200
committeruser@node5.net <user@node5.net>2026-05-31 15:14:06 +0200
commitc35426adf6ce638d0f26f1ce8d44c43d7c261ca9 (patch)
tree699ce066aa7e140af8e6189536fed75ba70cd59b /src
parent23cf16e4aed56300698879c1862ce84eab812aea (diff)
fix: don't require the git binary
Diffstat (limited to 'src')
-rw-r--r--src/article.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/article.py b/src/article.py
index 4fff8b5..31223f6 100644
--- a/src/article.py
+++ b/src/article.py
@@ -145,8 +145,12 @@ class ArticleGenerator:
article_args[
'url'] = f'{"/" if article_args["web_dir"] else ""}{"/".join(article_args["web_dir"])}/{article_args["name"]}'
- git_date = subprocess.run(['git', 'log', '-1', '--pretty=format:%ci', pathlib.Path(article_args['git_path']) \
- .relative_to(self.articles_path)], cwd=self.articles_path, capture_output=True, text=True).stdout
+ try:
+ git_date = subprocess.run(['git', 'log', '-1', '--pretty=format:%ci', pathlib.Path(article_args['git_path']) \
+ .relative_to(self.articles_path)], cwd=self.articles_path, capture_output=True, text=True).stdout
+ except FileNotFoundError:
+ logger.warning('"git" isn\'t installed, modified dates will use file system (worse data)')
+ git_date = ''
if git_date == '':
logger.warning("Article folder is not a git directory, modified dates will use file system (worse data)")
# Get article modified date time from file system