aoc

Advent of Code
git clone https://git.pngu.org/aoc
Log | Files | Refs | README

commit b75dee23d9302386a6227079b064e198dc6d922c
parent 04bd1b07358e0ae9bb8c94b728a6f687b21ccf56
Author: Jack Sangdahl <jack@pngu.org>
Date:   Thu,  4 Dec 2025 09:56:05 +0100

chore: Make script executable, small improvements

Diffstat:
Mdata.py | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/data.py b/data.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 import subprocess from datetime import datetime from os import getenv @@ -43,7 +44,9 @@ except subprocess.CalledProcessError as e: print(f"error fetching input: {e.stderr.decode('utf-8')}") exit(1) -source_file = Path(f"{day}_{year}.py") +source_dir = Path(f"{year}") +source_dir.mkdir(exist_ok=True) +source_file = source_dir / Path(f"{day}_{year}.py") if not source_file.exists(): source_file.touch()