This commit is contained in:
Dmitry 2025-12-03 03:23:35 +03:00
parent 68b3ed2deb
commit 9faa1ebb30

View file

@ -146,10 +146,21 @@ 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)"
# 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
}
# Function to check if build directory exists