From f93dcb23a41024db05eda30d2b7d5df952d80f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Wed, 16 Feb 2022 12:03:53 +0100 Subject: [PATCH] display config before executing template --- init.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/init.sh b/init.sh index df51dda..4a35b2f 100755 --- a/init.sh +++ b/init.sh @@ -19,15 +19,19 @@ echo "ALL PRIOR DATA, INCLUDING BUT NOT LIMITED TO THE GIT " echo "HISTORY IN THIS DIRECTORY AND ALL ITS SUBDIRECTORIES " echo "WILL BE LOST. " echo " " +echo "YOUR GIVEN CONFIGURATION IS AS FOLLOWS: " +echo "" +cat config | tail -n 5 +echo "" -read -p "ARE YOU SURE YOU WANT TO CONTINUE? (y/n) " -n 1 -r +read -p "ARE YOU SURE YOU WANT TO CONTINUE? (y/n) " -n 1 -r if [[ ! $REPLY =~ ^[Yy]$ ]] then exit 1 fi +echo "" # Move to new line { ## DO NOT REMOVE THIS OR EVERYTHING BLOWS UP -cat config cd template find -type f | xargs sed -i "s/\$mainfile/$(printf '%s\n' "$mainfile" | sed -e 's/[\/&]/\\&/g')/g" find -type f | xargs sed -i "s/\$course/$(printf '%s\n' "$course" | sed -e 's/[\/&]/\\&/g')/g"