Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

fix: correct error for env not found (#8320)

Shailesh-71471bed12edce1
diff --git a/scripts/setup.sh b/scripts/setup.sh
index e91ac92c35..1b40d3b555 100755
--- a/scripts/setup.sh
+++ b/scripts/setup.sh
@@ -299,24 +299,26 @@ check_services_health() {
HYPERSWITCH_BASE_URL="http://localhost:8080"
HYPERSWITCH_HEALTH_URL="${HYPERSWITCH_BASE_URL}/health"
HYPERSWITCH_DEEP_HEALTH_URL="${HYPERSWITCH_BASE_URL}/health/ready"
-
+ local is_success=true
# Basic health check
- health_response=$(curl --silent --fail "${HYPERSWITCH_HEALTH_URL}") || exit 0
+ health_response=$(curl --silent --fail "${HYPERSWITCH_HEALTH_URL}") || is_success=false
if [ "${health_response}" != "health is good" ]; then
- exit 0
+ is_success=false
fi
# Deep health check
- deep_health_response=$(curl --silent "${HYPERSWITCH_DEEP_HEALTH_URL}") || exit 0
+ deep_health_response=$(curl --silent --fail "${HYPERSWITCH_DEEP_HEALTH_URL}") || is_success=false
if [[ "$(echo "${deep_health_response}" | jq --raw-output '.error')" != "null" ]]; then
- exit 0
+ is_success=false
fi
# Extract version
- VERSION=$(curl --silent --output /dev/null --request GET --write-out '%header{x-hyperswitch-version}' "${HYPERSWITCH_BASE_URL}" | sed 's/-dirty$//')
- INSTALLATION_STATUS="success"
+ if [ "${is_success}" = true ]; then
+ VERSION=$(curl --silent --output /dev/null --request GET --write-out '%header{x-hyperswitch-version}' "${HYPERSWITCH_BASE_URL}" | sed 's/-dirty$//')
+ INSTALLATION_STATUS="success"
+ scarf_call
+ fi
print_access_info
- scarf_call
}
print_access_info() {
@@ -368,8 +370,8 @@ scarf_call
show_banner
detect_docker_compose
check_prerequisites
-source .oneclick-setup.env
setup_config
+source .oneclick-setup.env
select_profile
start_services
check_services_health