This implements what the Makefile did, but with a more intuitive interface. Remove the weeknotes target from the Makefile.
18 lines
398 B
Python
18 lines
398 B
Python
#!/usr/bin/env python3.12
|
|
# Eryn Wells <eryn@erynwells.me>
|
|
|
|
import os
|
|
import subprocess
|
|
import sys
|
|
|
|
|
|
def edit_file(path, editor=None):
|
|
editor = editor or os.environ.get('VISUAL') or os.environ.get('EDITOR') or 'vi'
|
|
subprocess.run(
|
|
f'{editor} "{path}"',
|
|
stdin=sys.stdin,
|
|
stdout=sys.stdout,
|
|
stderr=sys.stderr,
|
|
env=os.environ,
|
|
shell=True,
|
|
)
|