@@ -78,14 +78,17 @@ cd "$REPO_ROOT"
7878# Resolve package dependencies first
7979swift package resolve
8080
81+ # Convert package name to lowercase (bash 3.2 compatible)
82+ PACKAGE_NAME_LOWER=$( echo " $PACKAGE_NAME " | tr ' [:upper:]' ' [:lower:]' )
83+
8184# Generate documentation using swift package generate-documentation
8285# This requires the swift-docc-plugin to be added to Package.swift
8386if swift package --allow-writing-to-directory " $DOCBUILD_DIR " \
8487 generate-documentation \
8588 --target " $PACKAGE_NAME " \
8689 --output-path " $DOCBUILD_DIR " \
8790 --transform-for-static-hosting \
88- --hosting-base-path " /${PACKAGE_NAME,, } " 2>&1 ; then
91+ --hosting-base-path " /${PACKAGE_NAME_LOWER } " 2>&1 ; then
8992 echo -e " ${GREEN} DocC documentation generated successfully${NC} "
9093
9194 # The documentation is already transformed for static hosting in DOCBUILD_DIR
161164
162165# Determine the documentation directory
163166# For Swift packages, we'll publish to a subdirectory like /designalgorithmskit/
164- DOCS_DIR=" ${PACKAGE_NAME,,} " # Convert to lowercase
167+ DOCS_DIR=" $PACKAGE_NAME_LOWER " # Use lowercase version
165168mkdir -p " $DOCS_DIR "
166169
167170echo " Using documentation directory: $DOCS_DIR "
@@ -190,10 +193,10 @@ if [ -n "$STATIC_DOCS_DIR" ] && [ -d "$STATIC_DOCS_DIR" ]; then
190193<head>
191194 <meta charset="UTF-8">
192195 <meta name="viewport" content="width=device-width, initial-scale=1.0">
193- <meta http-equiv="refresh" content="0; url=/${DOCS_DIR} /documentation/${PACKAGE_NAME,, } /">
196+ <meta http-equiv="refresh" content="0; url=/${DOCS_DIR} /documentation/${PACKAGE_NAME_LOWER } /">
194197 <title>${PACKAGE_NAME} Documentation</title>
195198 <script>
196- window.location.href = "/${DOCS_DIR} /documentation/${PACKAGE_NAME,, } /";
199+ window.location.href = "/${DOCS_DIR} /documentation/${PACKAGE_NAME_LOWER } /";
197200 </script>
198201</head>
199202<body>
0 commit comments