From bf45ddc125c704c5e7b36be790b71ef9f0373692 Mon Sep 17 00:00:00 2001 From: HexaField Date: Sun, 18 Aug 2024 12:20:23 +1000 Subject: [PATCH] bug fix for backend services not running --- package.json | 2 +- packages/server-core/src/services.ts | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 18757cf581..b34cb6b011 100755 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "dev-docker": "cd scripts && ./start-containers.sh", "dev-docker-windows": "cd scripts && docker-compose up -d && docker-compose up -d -f docker-compose-minio.yml", "dev-tabs": "npm run dev-docker && cd scripts && ./dev-tabs.sh", - "fetch-projects": "lerna exec 'git fetch -p && git rebase' --parallel --ignore @etherealengine/* --no-bail", + "fetch-projects": "lerna exec 'git fetch -p && git rebase' --parallel --no-bail", "dev-reinit": "./scripts/checkenv.sh && npm run dev-docker && cd packages/server && npm run dev-reinit-db", "dev-server": "cd packages/server && npm run dev", "dev-windows": "npm run dev-docker-windows && concurrently -n agones,server,client npm:dev-agones-silent npm:dev-server npm:dev-client", diff --git a/packages/server-core/src/services.ts b/packages/server-core/src/services.ts index d4f8661188..979b0769b0 100755 --- a/packages/server-core/src/services.ts +++ b/packages/server-core/src/services.ts @@ -49,13 +49,20 @@ import WorldServices from './world/services' const installedProjects = fs.existsSync(path.resolve(__dirname, '../../projects/projects')) ? fs .readdirSync(path.resolve(__dirname, '../../projects/projects'), { withFileTypes: true }) - .filter((dirent) => dirent.isDirectory()) - .map((dirent) => { + .filter((orgDir) => orgDir.isDirectory()) + .map((orgDir) => { + return fs + .readdirSync(path.resolve(__dirname, '../../projects/projects', orgDir.name), { withFileTypes: true }) + .filter((projectDir) => projectDir.isDirectory()) + .map((projectDir) => `${orgDir.name}/${projectDir.name}`) + }) + .flat() + .map((projectName) => { try { - const configPath = `../../projects/projects/${dirent.name}/xrengine.config.ts` + const configPath = `../../projects/projects/${projectName}/xrengine.config.ts` const config: ProjectConfigInterface = require(configPath).default if (!config.services) return null - return path.join(dirent.name, config.services) + return path.join(projectName, config.services) } catch (e) { // console.log(e) }