Add a check to make sure the CPM source cache is not set to somewhere with spaces in the path

This commit is contained in:
cheezwiz7899
2026-05-14 16:01:51 +10:00
parent 8d6e94e8b4
commit a5407ba529
2 changed files with 20 additions and 0 deletions
+10
View File
@@ -194,6 +194,16 @@ header() {
echo -e "${BOLD}${GREEN}=================================================================${RESET}" >&2
}
# =============================================================================
# Validate CPM_SOURCE_CACHE
# =============================================================================
if [[ "${CPM_SOURCE_CACHE}" == *" "* ]]; then
error "CPM_SOURCE_CACHE ('${CPM_SOURCE_CACHE}') contains spaces.\n" \
" CPM and some build tools do not support paths with spaces.\n" \
" Please set CPM_SOURCE_CACHE to a path without spaces, e.g.:\n" \
" export CPM_SOURCE_CACHE=\"/tmp/cpm-cache\""
fi
# =============================================================================
# Architecture flags
# =============================================================================
+10
View File
@@ -369,6 +369,16 @@ header() { echo -e "\n${BOLD}${GREEN}==========================================
echo -e "${BOLD}${GREEN} $*${RESET}"; \
echo -e "${BOLD}${GREEN}=================================================================${RESET}"; }
# =============================================================================
# Validate CPM_SOURCE_CACHE
# =============================================================================
if [[ "${CPM_SOURCE_CACHE}" == *" "* ]]; then
error "CPM_SOURCE_CACHE ('${CPM_SOURCE_CACHE}') contains spaces.\n" \
" CPM and some build tools do not support paths with spaces.\n" \
" Please set CPM_SOURCE_CACHE to a path without spaces, e.g.:\n" \
" export CPM_SOURCE_CACHE=\"/tmp/cpm-cache\""
fi
# _sudo — portable sudo wrapper.
# On Windows/MSYS2, sudo is unavailable; run privileged commands directly.
# On Linux, delegate to the real sudo as usual.