diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 282674b..ff2fb8a 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -105,26 +105,25 @@ preflight_checks() { pull_code() { print_header "Pulling Latest Code" - # Pull backend - if [ -d "backend/.git" ]; then + if [ -d ".git" ]; then + print_info "Pulling monorepo..." + git pull origin main + print_success "Code updated" + elif [ -d "backend/.git" ]; then print_info "Pulling backend repository..." - cd backend - git pull - cd .. + cd backend && git pull && cd .. print_success "Backend code updated" - else - print_warning "Backend is not a git repository, skipping pull" - fi - # Pull frontend - if [ -d "frontend/.git" ]; then - print_info "Pulling frontend repository..." - cd frontend - git pull - cd .. - print_success "Frontend code updated" + if [ -d "frontend/.git" ]; then + print_info "Pulling frontend repository..." + cd frontend && git pull && cd .. + print_success "Frontend code updated" + else + print_warning "Frontend is not a git repository, skipping pull" + fi else - print_warning "Frontend is not a git repository, skipping pull" + print_error "No git repository found. Cannot pull latest code." + exit 1 fi echo ""