add template safety check
This commit is contained in:
parent
8ffad3ff1b
commit
44206f5f8d
1 changed files with 6 additions and 0 deletions
6
init.sh
6
init.sh
|
@ -1,4 +1,10 @@
|
||||||
#!/bin/bash
|
#!/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
|
{ ## DO NOT REMOVE THIS OR EVERYTHING BLOWS UP
|
||||||
source config
|
source config
|
||||||
find -type f | xargs sed -i "s/\$mainfile/$(printf '%s\n' "$mainfile" | sed -e 's/[\/&]/\\&/g')/g"
|
find -type f | xargs sed -i "s/\$mainfile/$(printf '%s\n' "$mainfile" | sed -e 's/[\/&]/\\&/g')/g"
|
||||||
|
|
Loading…
Reference in a new issue