diff options
author | Jordan <me@jordan.im> | 2021-12-29 03:53:38 -0700 |
---|---|---|
committer | Jordan <me@jordan.im> | 2021-12-29 03:53:38 -0700 |
commit | fcc3ea23ded0e4978bb9a14ba9ad5953d79b55b0 (patch) | |
tree | 7bdd4b15ba0bbde709e86472f2c740c6c1d2869b /scripts/cgit-last-modified.py | |
parent | 51aa333b4f5b6b2ba3929a53cac8b38aea58c5c8 (diff) | |
download | dotfiles-fcc3ea23ded0e4978bb9a14ba9ad5953d79b55b0.tar.gz dotfiles-fcc3ea23ded0e4978bb9a14ba9ad5953d79b55b0.zip |
rm scripts, moved to bin repo
Diffstat (limited to 'scripts/cgit-last-modified.py')
-rwxr-xr-x | scripts/cgit-last-modified.py | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/scripts/cgit-last-modified.py b/scripts/cgit-last-modified.py deleted file mode 100755 index 46d7720..0000000 --- a/scripts/cgit-last-modified.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env python3 - -import git -import os -from datetime import datetime, timezone, timedelta - -REPOS = "/var/www/git.jordan.im/repositories" - -for x in os.listdir(REPOS): - if not os.path.isdir(os.path.join(REPOS, x)): - continue - - print(f"processing {x}...") - - try: - repo = git.Repo(os.path.join(REPOS, x)) - for remote in repo.remotes: - remote.fetch() - md = repo.head.commit.committed_datetime - md = md.astimezone(timezone.utc).strftime("%Y-%m-%d %H:%M:%S") - except Exception as e: - sys.stderr.write(e) - continue - - d = os.path.join(REPOS, x, "info/web/") - os.makedirs(d, exist_ok=True) - - f = open(os.path.join(d, "last-modified"), "w") - f.write(md) - f.close() |