From 13bc8e2cf08b834f69214bc1f7038c8f9e23a642 Mon Sep 17 00:00:00 2001 From: purple Date: Tue, 30 Jan 2024 23:48:09 +0100 Subject: [PATCH] feat `core`: Additional error validation on custom navigation routes --- blueprint.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/blueprint.sh b/blueprint.sh index 08fd254..8f726b1 100644 --- a/blueprint.sh +++ b/blueprint.sh @@ -773,6 +773,16 @@ if [[ ( $2 == "-i" ) || ( $2 == "-install" ) ]]; then VCMD="y" exit 1 fi + # Validate file path. + if [[ ! -f ".blueprint/tmp/$n/$dashboard_components/${COMPONENTS_ROUTE_COMP}.tsx" ]] && + [[ ! -f ".blueprint/tmp/$n/$dashboard_components/${COMPONENTS_ROUTE_COMP}.ts" ]] && + [[ ! -f ".blueprint/tmp/$n/$dashboard_components/${COMPONENTS_ROUTE_COMP}.jsx" ]] && + [[ ! -f ".blueprint/tmp/$n/$dashboard_components/${COMPONENTS_ROUTE_COMP}.js" ]]; then + rm -R ".blueprint/tmp/$n" + PRINT FATAL "Navigation route configuration points towards one or more components that do not exist." + exit 1 + fi + # Return error if identifier is generated incorrectly. if [[ $COMPONENTS_ROUTE_IDEN == "" ]]; then rm -R ".blueprint/tmp/$n"