Commit 4799f612 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

debug

parent dbd27707
Loading
Loading
Loading
Loading
+8 −10
Original line number Diff line number Diff line
@@ -74,21 +74,19 @@ echo "$configs" | while read -r config; do
    fi
    
    # Find corresponding openapi name for this config
    # First get the config block containing our config file
    # Get the entire config block containing our config file
    config_block=$(echo "$project_section" | awk -v cfg="$config" '
        /config_file:.*"'"$config"'"/ {
            # Print previous line (openapi_name)
            printf "%s\n", p
            # Print current line
            print
        }
        { p=$0 }
        /[[:space:]]*-/ { in_block=0 }  # Start of new block
        in_block { print }              # Print lines while in block
        $0 ~ "config_file:.*\""cfg"\"" { in_block=1; print }  # Found our config, start block
    ')
    # Then extract the openapi_name from it
    new_name=$(echo "$config_block" | grep "openapi_name" | sed 's/.*openapi_name:[[:space:]]*"\(.*\)".*/\1/')
    
    echo "Config block found:"
    echo "$config_block"
    
    # Then extract the openapi_name from it
    new_name=$(echo "$config_block" | grep "openapi_name" | sed 's/.*openapi_name:[[:space:]]*"\(.*\)".*/\1/')
    
    echo "Found OpenAPI file name: $new_name"

    if [ ! -z "$new_name" ]; then