Sync from GitHub main #1
@@ -1,4 +1,4 @@
|
|||||||
# Stage server/ next to the Host GUI, preserving an existing local config.
|
# Stage server/ next to the Host GUI while preserving local runtime state.
|
||||||
if(NOT EXISTS "${CO_SERVER_SOURCE_DIR}")
|
if(NOT EXISTS "${CO_SERVER_SOURCE_DIR}")
|
||||||
message(FATAL_ERROR "Server source directory not found: ${CO_SERVER_SOURCE_DIR}")
|
message(FATAL_ERROR "Server source directory not found: ${CO_SERVER_SOURCE_DIR}")
|
||||||
endif()
|
endif()
|
||||||
@@ -13,17 +13,24 @@ if(EXISTS "${CO_SERVER_STAGE_CONFIG}")
|
|||||||
file(READ "${CO_SERVER_STAGE_CONFIG}" _preserve_config)
|
file(READ "${CO_SERVER_STAGE_CONFIG}" _preserve_config)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(_stage_bans "${CO_SERVER_STAGE_DIR}/bans.json")
|
||||||
|
set(_preserve_bans "")
|
||||||
|
if(EXISTS "${_stage_bans}")
|
||||||
|
file(READ "${_stage_bans}" _preserve_bans)
|
||||||
|
endif()
|
||||||
|
|
||||||
file(REMOVE_RECURSE "${CO_SERVER_STAGE_DIR}")
|
file(REMOVE_RECURSE "${CO_SERVER_STAGE_DIR}")
|
||||||
file(MAKE_DIRECTORY "${CO_SERVER_STAGE_DIR}")
|
file(MAKE_DIRECTORY "${CO_SERVER_STAGE_DIR}")
|
||||||
|
|
||||||
# Prefer a filtered copy so Python caches do not ship with the build.
|
# Prefer a filtered copy so caches and local runtime state do not ship with the build.
|
||||||
file(GLOB _server_entries RELATIVE "${CO_SERVER_SOURCE_DIR}" "${CO_SERVER_SOURCE_DIR}/*")
|
file(GLOB _server_entries RELATIVE "${CO_SERVER_SOURCE_DIR}" "${CO_SERVER_SOURCE_DIR}/*")
|
||||||
foreach(_entry IN LISTS _server_entries)
|
foreach(_entry IN LISTS _server_entries)
|
||||||
if(_entry STREQUAL "__pycache__"
|
if(_entry STREQUAL "__pycache__"
|
||||||
OR _entry STREQUAL ".pytest_cache"
|
OR _entry STREQUAL ".pytest_cache"
|
||||||
OR _entry STREQUAL ".venv"
|
OR _entry STREQUAL ".venv"
|
||||||
OR _entry STREQUAL "logs"
|
OR _entry STREQUAL "logs"
|
||||||
OR _entry STREQUAL "tests")
|
OR _entry STREQUAL "tests"
|
||||||
|
OR _entry STREQUAL "bans.json")
|
||||||
continue()
|
continue()
|
||||||
endif()
|
endif()
|
||||||
file(COPY "${CO_SERVER_SOURCE_DIR}/${_entry}"
|
file(COPY "${CO_SERVER_SOURCE_DIR}/${_entry}"
|
||||||
@@ -33,6 +40,7 @@ foreach(_entry IN LISTS _server_entries)
|
|||||||
PATTERN ".pytest_cache" EXCLUDE
|
PATTERN ".pytest_cache" EXCLUDE
|
||||||
PATTERN ".venv" EXCLUDE
|
PATTERN ".venv" EXCLUDE
|
||||||
PATTERN "logs" EXCLUDE
|
PATTERN "logs" EXCLUDE
|
||||||
|
PATTERN "bans.json" EXCLUDE
|
||||||
)
|
)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
@@ -40,6 +48,10 @@ if(NOT "${_preserve_config}" STREQUAL "")
|
|||||||
file(WRITE "${CO_SERVER_STAGE_CONFIG}" "${_preserve_config}")
|
file(WRITE "${CO_SERVER_STAGE_CONFIG}" "${_preserve_config}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(NOT "${_preserve_bans}" STREQUAL "")
|
||||||
|
file(WRITE "${_stage_bans}" "${_preserve_bans}")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(NOT EXISTS "${CO_SERVER_STAGE_DIR}/consumer_server_cli.py")
|
if(NOT EXISTS "${CO_SERVER_STAGE_DIR}/consumer_server_cli.py")
|
||||||
message(FATAL_ERROR
|
message(FATAL_ERROR
|
||||||
"Failed to stage server entrypoint to ${CO_SERVER_STAGE_DIR}/consumer_server_cli.py")
|
"Failed to stage server entrypoint to ${CO_SERVER_STAGE_DIR}/consumer_server_cli.py")
|
||||||
|
|||||||
Reference in New Issue
Block a user