From 9faa1ebb30ca0d7ea77859f07258eee9e941789a Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 3 Dec 2025 03:23:35 +0300 Subject: [PATCH] fix --- tools/deploy/admin/config.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/deploy/admin/config.sh b/tools/deploy/admin/config.sh index 61b0170..89bf36e 100644 --- a/tools/deploy/admin/config.sh +++ b/tools/deploy/admin/config.sh @@ -146,9 +146,20 @@ print_info() { # Function to check if running from correct directory check_project_root() { + # If we're not in the React project root, try to navigate there if [ ! -f "package.json" ]; then - print_error "Please run this script from the React project root directory (mnemo_cards_admin/web)" - exit 1 + # Assume we're running from tools/deploy/admin, navigate to mnemo_cards_admin/web + SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + PROJECT_ROOT="$(cd "$SCRIPT_DIR/../../../mnemo_cards_admin/web" && pwd)" + + if [ -f "$PROJECT_ROOT/package.json" ]; then + print_info "Navigating to React project root: $PROJECT_ROOT" + cd "$PROJECT_ROOT" + else + print_error "Please run this script from the React project root directory (mnemo_cards_admin/web) or from tools/deploy/admin/" + print_error "Could not find package.json at: $PROJECT_ROOT" + exit 1 + fi fi }