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

Debug

parent b23039ef
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -74,8 +74,21 @@ echo "$configs" | while read -r config; do
    fi
    
    # Find corresponding openapi name for this config
    new_name=$(echo "$project_section" | grep -B1 "config_file:.*$config" | grep "openapi_name" | sed 's/.*openapi_name:[[:space:]]*"\(.*\)".*/\1/')
    
    # First get the 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 }
    ')
    # 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"
    echo "Found OpenAPI file name: $new_name"

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