From e6398f76096cc17db313152986289ecc9c71b27d Mon Sep 17 00:00:00 2001 From: purple Date: Sun, 23 Jul 2023 17:41:32 +0200 Subject: [PATCH] Fix for "input file is output file" --- blueprint.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/blueprint.sh b/blueprint.sh index aa95654..d8186b9 100644 --- a/blueprint.sh +++ b/blueprint.sh @@ -437,7 +437,10 @@ if [[ ( $2 == "-i" ) || ( $2 == "-install" ) ]]; then sed -i "s~~~g" resources/views/templates/wrapper.blade.php; sed -i "s~~~g" resources/views/templates/wrapper.blade.php; fi; - cat <(echo "") .blueprint/tmp/$n/$dashboard_wrapper > .blueprint/tmp/$n/$dashboard_wrapper; + touch .blueprint/tmp/$n/$dashboard_wrapper.BLUEPRINTBAK; + cat <(echo "") .blueprint/tmp/$n/$dashboard_wrapper > .blueprint/tmp/$n/$dashboard_wrapper.BLUEPRINTBAK; + cp .blueprint/tmp/$n/$dashboard_wrapper.BLUEPRINTBAK .blueprint/tmp/$n/$dashboard_wrapper; + rm .blueprint/tmp/$n/$dashboard_wrapper.BLUEPRINTBAK; echo "" >> .blueprint/tmp/$n/$dashboard_wrapper; sed -i "/<\!-- wrapper:insert -->/r .blueprint/tmp/$n/$dashboard_wrapper" resources/views/templates/wrapper.blade.php; fi; @@ -449,7 +452,10 @@ if [[ ( $2 == "-i" ) || ( $2 == "-install" ) ]]; then sed -i "s~~~g" resources/views/layouts/admin.blade.php; sed -i "s~~~g" resources/views/layouts/admin.blade.php; fi; - cat <(echo "") .blueprint/tmp/$n/$admin_wrapper > .blueprint/tmp/$n/$admin_wrapper; + touch .blueprint/tmp/$n/$admin_wrapper.BLUEPRINTBAK; + cat <(echo "") .blueprint/tmp/$n/$admin_wrapper > .blueprint/tmp/$n/$admin_wrapper.BLUEPRINTBAK; + cp .blueprint/tmp/$n/$admin_wrapper.BLUEPRINTBAK .blueprint/tmp/$n/$admin_wrapper; + rm .blueprint/tmp/$n/$admin_wrapper.BLUEPRINTBAK; echo "" >> .blueprint/tmp/$n/$admin_wrapper; sed -i "/<\!-- wrapper:insert -->/r .blueprint/tmp/$n/$admin_wrapper" resources/views/layouts/admin.blade.php; fi;