Files
Thun/implementations/Python/Makefile
T
sforman 23504f6ede Use Python as SHELL in Makefile.
It's a simple task, but I'm not up on my CLI tools, so I went with
Python instead of sh.  The split command doesn't have '-p' switch on
Ubuntu.  (I'm using Ubuntu on this laptop because it can correctly
configure the WiFi and the laptop has no ethernet port.)
2023-07-27 10:32:45 -07:00

14 lines
360 B
Makefile

SHELL != which python
.ONESHELL:
joy: joy.py ../defs.txt
from pathlib import Path
SPLIT_PATTERN = "'''.splitlines()\n"
joy_source = Path('joy.py').read_text()
defs_source = Path('../defs.txt').read_text()
head, sep, tail = joy_source.partition(SPLIT_PATTERN)
joy = Path('joy')
joy.write_text(''.join((head, defs_source, sep, tail)))
joy.chmod(0o775)