it might not exist yet

This commit is contained in:
Daylin Morgan 2025-02-18 18:08:40 -06:00
parent e925eb133b
commit e6d9313334
Signed by: daylin
GPG key ID: 950D13E9719334AD

View file

@ -7,9 +7,9 @@ from tempfile import mkdtemp
SCRATCH_DIR = Path.home() / "scratch"
WEEK_SCRATCH = SCRATCH_DIR / datetime.now().strftime("%Y/%U")
(SCRATCH_DIR / "current").unlink()
(SCRATCH_DIR / "current").symlink_to(WEEK_SCRATCH)
if (SCRATCH_CURRENT := SCRATCH_DIR / "current").is_dir():
SCRATCH_CURRENT.unlink()
SCRATCH_CURRENT.symlink_to(WEEK_SCRATCH)
def scratch_maintenance():