From 2bcaa7e246e674160eb96846e94ace139e13e33c Mon Sep 17 00:00:00 2001 From: dtb Date: Sun, 16 Jul 2023 02:08:15 -0400 Subject: [PATCH] create files correctly --- homepage/homepage | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/homepage/homepage b/homepage/homepage index 6d59e6d..5bc6eea 100644 --- a/homepage/homepage +++ b/homepage/homepage @@ -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