Files
misctils/genfs.sh
2025-09-17 23:05:25 -04:00

16 lines
321 B
Bash
Executable File

#!/bin/sh
# generate fs files because we can't do directory traversal from js within a
# browser.
for d in ./startpage/root/*; do
if [ ! -d "$d" ]; then
continue
fi
s=""
for f in "$d"/*; do
s=${s:+$s\\n}$(echo "$f" | cut -d '/' -f 5-)
done
echo "$s" > ./startpage/root/."$(echo "$d" | cut -d '/' -f 4-)"
done