mjestecko/upload.sh
2023-05-26 00:00:38 +05:00

18 lines
450 B
Bash
Executable File

#!/usr/bin/bash
# todo: Create local cache containing file timestamps that were previously uploaded.
for cur in ./html/{*,*/*,*/*/*}; do
if [[ "$cur" == *"/tracks/"* ]]; then
continue
fi
if [ -f "$cur" ]; then
d=$(dirname $(realpath --relative-to="./html" "$cur"))
if [[ "$d" == "." ]]; then
neocities upload $cur
else
neocities upload -d $(dirname $(realpath --relative-to="./html" "$cur")) $cur
fi
fi
done