cli: check for dev/index.ts

Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
This commit is contained in:
Vincenzo Scamporlino
2023-11-24 16:55:48 +01:00
parent 2be3d465f8
commit 4665709122
@@ -49,12 +49,14 @@ export async function startBackend(options: StartBackendOptions) {
export async function startBackendPlugin(options: StartBackendOptions) {
if (!process.env.LEGACY_BACKEND_START) {
const hasDevEntry = await fs.pathExists(paths.resolveTarget('dev'));
const hasDevIndexEntry = await fs.pathExists(
paths.resolveTarget('dev', 'index.ts'),
);
const hasSrcIndexEntry = await fs.pathExists(
paths.resolveTarget('src', 'run.ts'),
);
if (!hasDevEntry && !hasSrcIndexEntry) {
if (!hasDevIndexEntry && !hasSrcIndexEntry) {
console.warn(
hasSrcIndexEntry
? `The 'dev' directory is missing. The plugin might not be updated for the new backend system. To run, use "LEGACY_BACKEND_START=1 yarn start".`