Fix?
Some checks failed
Build Dusk / build-linux (push) Failing after 52s
Build Dusk / build-psp (push) Failing after 55s

This commit is contained in:
2025-11-15 22:29:07 -06:00
parent 67f62daa9f
commit 7b9f8b190e

View File

@@ -15,17 +15,15 @@ file(STRINGS "${ENV_FILE}" ENV_LINES)
set(HEADER_CONTENT "#pragma once\n#include \"dusk.h\"\n\n") set(HEADER_CONTENT "#pragma once\n#include \"dusk.h\"\n\n")
foreach(line IN LISTS ENV_LINES) foreach(line IN LISTS ENV_LINES)
# Only trim whitespace if line is not empty
if(NOT line STREQUAL "")
string(REGEX REPLACE "^[ \t]*" "" line "${line}")
string(REGEX REPLACE "[ \t]*$" "" line "${line}")
endif()
# Skip comments and empty lines (allow whitespace before # or ;) # Skip comments and empty lines (allow whitespace before # or ;)
if(line STREQUAL "" OR line MATCHES "^[ \t]*[#;]") if(line STREQUAL "" OR line MATCHES "^[ \t]*[#;]")
continue() continue()
endif() endif()
# Trim whitespace only for non-empty, non-comment lines
string(REGEX REPLACE "^[ \t]*" "" line "${line}")
string(REGEX REPLACE "[ \t]*$" "" line "${line}")
# Expect KEY=VALUE (allow spaces around '=') # Expect KEY=VALUE (allow spaces around '=')
if(NOT line MATCHES "^[A-Za-z_][A-Za-z0-9_]*[ \t]*=[ \t]*") if(NOT line MATCHES "^[A-Za-z_][A-Za-z0-9_]*[ \t]*=[ \t]*")
message(WARNING "Skipping invalid line in ${ENV_FILE}: '${line}'") message(WARNING "Skipping invalid line in ${ENV_FILE}: '${line}'")