added date to created skratch files

This commit is contained in:
phixxy 2026-03-05 02:00:39 -08:00
parent 6e65aa1b9c
commit 577cce47c4

View file

@ -5,6 +5,7 @@ import os
import random
import string
import argparse
import time
def make_dir(d):
if not os.path.exists(d):
@ -59,7 +60,8 @@ def mkstemp(fp):
def run(editor, sk_path, filename=None):
if not filename:
filename = "skratch-XXXXXX"
t = time.localtime()
filename = f"skratch-{t.tm_year}-{t.tm_mon}-{t.tm_mday}-XXXXXX"
fp = os.path.join(sk_path, filename)
fp = mkstemp(fp)
else: