display config before executing template

This commit is contained in:
Maximilian Keßler 2022-02-16 12:03:53 +01:00
parent 46af218046
commit f93dcb23a4

View file

@ -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 "HISTORY IN THIS DIRECTORY AND ALL ITS SUBDIRECTORIES "
echo "WILL BE LOST. " echo "WILL BE LOST. "
echo " " 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]$ ]] if [[ ! $REPLY =~ ^[Yy]$ ]]
then then
exit 1 exit 1
fi fi
echo "" # Move to new line
{ ## DO NOT REMOVE THIS OR EVERYTHING BLOWS UP { ## DO NOT REMOVE THIS OR EVERYTHING BLOWS UP
cat config
cd template 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/\$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" find -type f | xargs sed -i "s/\$course/$(printf '%s\n' "$course" | sed -e 's/[\/&]/\\&/g')/g"