fix
This commit is contained in:
parent
68b3ed2deb
commit
9faa1ebb30
1 changed files with 13 additions and 2 deletions
|
|
@ -146,10 +146,21 @@ print_info() {
|
||||||
|
|
||||||
# Function to check if running from correct directory
|
# Function to check if running from correct directory
|
||||||
check_project_root() {
|
check_project_root() {
|
||||||
|
# If we're not in the React project root, try to navigate there
|
||||||
if [ ! -f "package.json" ]; then
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to check if build directory exists
|
# Function to check if build directory exists
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue