Fix installation issue with missing server.js
Fixed a critical installation issue where server.js and server-endpoints.js were not being copied to the install directory. This caused the service to fail with 'Cannot find module' errors when trying to start. Changes: - Updated copy_module_files in file-creator-module.sh to also copy main server files - Added error handling if server.js is missing - Added better logging during file copying 💡 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
		| @@ -1835,6 +1835,28 @@ function copy_module_files() { | |||||||
|     fi |     fi | ||||||
|   done |   done | ||||||
|    |    | ||||||
|  |   # Copy main server files | ||||||
|  |   echo "Copying main server files..." | ||||||
|  |    | ||||||
|  |   # server.js | ||||||
|  |   if [ -f "${SCRIPT_DIR}/server.js" ]; then | ||||||
|  |     cp "${SCRIPT_DIR}/server.js" "$INSTALL_DIR/" | ||||||
|  |     log "INFO" "Copied main server file: server.js" | ||||||
|  |     chown "$USER:$USER" "$INSTALL_DIR/server.js" | ||||||
|  |     chmod 644 "$INSTALL_DIR/server.js" | ||||||
|  |   else | ||||||
|  |     log "ERROR" "Main server file server.js not found in source directory" | ||||||
|  |     return 1 | ||||||
|  |   fi | ||||||
|  |    | ||||||
|  |   # server-endpoints.js (if it exists) | ||||||
|  |   if [ -f "${SCRIPT_DIR}/server-endpoints.js" ]; then | ||||||
|  |     cp "${SCRIPT_DIR}/server-endpoints.js" "$INSTALL_DIR/" | ||||||
|  |     log "INFO" "Copied API endpoints file: server-endpoints.js" | ||||||
|  |     chown "$USER:$USER" "$INSTALL_DIR/server-endpoints.js" | ||||||
|  |     chmod 644 "$INSTALL_DIR/server-endpoints.js" | ||||||
|  |   fi | ||||||
|  |    | ||||||
|   # Function to create bidirectional symlinks for module compatibility |   # Function to create bidirectional symlinks for module compatibility | ||||||
|   create_bidirectional_links() { |   create_bidirectional_links() { | ||||||
|     local hyphenated="$1" |     local hyphenated="$1" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user