diff --git a/scripts/build-android.sh b/scripts/build-android.sh index f57f70c7..2d978712 100755 --- a/scripts/build-android.sh +++ b/scripts/build-android.sh @@ -351,8 +351,18 @@ fi # Setup application directories setup_app_directories -# Load environment from .env file if it exists -load_env_file ".env" +# Load environment-specific .env file if it exists +env_file=".env.$BUILD_MODE" +if [ -f "$env_file" ]; then + load_env_file "$env_file" +else + log_debug "No $env_file file found, using default environment" +fi + +# Load .env file if it exists (fallback) +if [ -f ".env" ]; then + load_env_file ".env" +fi # Handle clean-only mode if [ "$CLEAN_ONLY" = true ]; then diff --git a/scripts/build-electron.sh b/scripts/build-electron.sh index 96213afa..ef370d00 100755 --- a/scripts/build-electron.sh +++ b/scripts/build-electron.sh @@ -341,7 +341,19 @@ main_electron_build() { # Setup environment setup_build_env "electron" "$BUILD_MODE" setup_app_directories - load_env_file ".env" + + # Load environment-specific .env file if it exists + env_file=".env.$BUILD_MODE" + if [ -f "$env_file" ]; then + load_env_file "$env_file" + else + log_debug "No $env_file file found, using default environment" + fi + + # Load .env file if it exists (fallback) + if [ -f ".env" ]; then + load_env_file ".env" + fi # Step 1: Clean Electron build artifacts clean_electron_artifacts diff --git a/scripts/build-ios.sh b/scripts/build-ios.sh index 511358d5..fd4e9a39 100755 --- a/scripts/build-ios.sh +++ b/scripts/build-ios.sh @@ -324,8 +324,18 @@ fi # Setup application directories setup_app_directories -# Load environment from .env file if it exists -load_env_file ".env" +# Load environment-specific .env file if it exists +env_file=".env.$BUILD_MODE" +if [ -f "$env_file" ]; then + load_env_file "$env_file" +else + log_debug "No $env_file file found, using default environment" +fi + +# Load .env file if it exists (fallback) +if [ -f ".env" ]; then + load_env_file ".env" +fi # Validate iOS environment validate_ios_environment