1
0

create files correctly

This commit is contained in:
dtb 2023-07-16 02:08:15 -04:00
parent c5ac00781d
commit 2bcaa7e246

View File

@ -3,10 +3,15 @@
set -ex
<"$0" python3 -c "import os, sys
for day in sys.stdin.read().split('\n\n\n'):
f = day.split('\n')[0]; if f[0] == '#': continue
f = day.split('\n')[0]
if f[0] != '/':
continue
f = '.' + f
d = '/'.join(f.split('/')[:-1])
if '/' in f and not(os.path.isdir(d)): os.makedirs(d)
with open(f,'w') as fd: fd.write(day)"
if '/' in f and not(os.path.isdir(d)) and not(d == ''):
os.makedirs(d)
with open(f,'w') as fd:
fd.write(day)"
test -f homepage.local \
&& exec ./homepage.local \
|| exit 0
@ -10216,3 +10221,7 @@ trust them a bit more than a bald guy on Spotify.
Today's Juneteenth, which is a memory to a pretty cool event, the end
of lawful slavery in the United States.
/clean.sh
# cleanup script