add template safety check

This commit is contained in:
Maximilian Keßler 2022-02-15 23:51:27 +01:00
parent 8ffad3ff1b
commit 44206f5f8d

View file

@ -1,4 +1,10 @@
#!/bin/bash
if [[ $(pwd) == *template* ]]
then
echo "Don't run this in the template directory!"
echo "Rename the current folder or edit init.sh to do this anyways"
exit
fi
{ ## DO NOT REMOVE THIS OR EVERYTHING BLOWS UP
source config
find -type f | xargs sed -i "s/\$mainfile/$(printf '%s\n' "$mainfile" | sed -e 's/[\/&]/\\&/g')/g"