From 44206f5f8de4f821f43c4dd0ed63f9f1ed326324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Tue, 15 Feb 2022 23:51:27 +0100 Subject: [PATCH] add template safety check --- init.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/init.sh b/init.sh index d0375a6..7622121 100755 --- a/init.sh +++ b/init.sh @@ -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"