From 64ab445c54abaabe2e09ac6848ccc766fc95a817 Mon Sep 17 00:00:00 2001 From: purple Date: Sat, 30 Sep 2023 16:33:59 +0200 Subject: [PATCH] Attempt at fixing route removal. --- blueprint.sh | 6 ++---- blueprint/data/internal/build/extensions/route.php | 5 +---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/blueprint.sh b/blueprint.sh index e7f9008..7f7260f 100644 --- a/blueprint.sh +++ b/blueprint.sh @@ -739,10 +739,8 @@ if [[ ( $2 == "-r" ) || ( $2 == "-remove" ) ]]; then VCMD="y" # Remove admin routes log_bright "[INFO] Removing admin routes.." - OLDROUTE_RESULT=$(sed ':a;N;$!ba;s/\n/___NEWLINE___/g' .blueprint/data/extensions/$identifier/.store/build/route.php) # Read the contents of route.php into the variable, replacing \n with a placeholder string - sed -i "s#$(echo "$OLDROUTE_RESULT" | sed 's/[\/&]/\\&/g')##g" routes/admin.php # Perform the sed operation, using the placeholder string as the delimiter - OLDROUTE_RESULT=$(echo "$OLDROUTE_RESULT" | sed 's/___NEWLINE___/\n/g') # Restore the original newlines in the $OLDROUTE_RESULT variable - + OLDROUTE_RESULT=$(cat .blueprint/data/extensions/$identifier/.store/build/route.php | sed "s#\n##g") + sed -i "s#$OLDROUTE_RESULT##g" routes/admin.php # Perform the sed operation, using the placeholder string as the delimiter # Remove admin view log_bright "[INFO] Removing admin view.." rm -R resources/views/admin/extensions/$identifier diff --git a/blueprint/data/internal/build/extensions/route.php b/blueprint/data/internal/build/extensions/route.php index 6ee62ef..d7fb784 100644 --- a/blueprint/data/internal/build/extensions/route.php +++ b/blueprint/data/internal/build/extensions/route.php @@ -1,4 +1 @@ -Route::group(['prefix' => 'extensions/␀id␀'], function () { - Route::get('/', [Admin\Extensions\␀id␀\␀id␀ExtensionController::class, 'index'])->name('admin.extensions.␀id␀.index'); - Route::patch('/', [Admin\Extensions\␀id␀\␀id␀ExtensionController::class, 'update']); -}); \ No newline at end of file +Route::group(['prefix' => 'extensions/␀id␀'], function () {Route::get('/', [Admin\Extensions\␀id␀\␀id␀ExtensionController::class, 'index'])->name('admin.extensions.␀id␀.index');Route::patch('/', [Admin\Extensions\␀id␀\␀id␀ExtensionController::class, 'update']);}); \ No newline at end of file