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:
MasterDraco 2025-03-07 11:51:09 +00:00
parent f2b217ad84
commit 9b45e669e2

View File

@ -1835,6 +1835,28 @@ function copy_module_files() {
fi
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
create_bidirectional_links() {
local hyphenated="$1"