diff --git a/plop/plopfile.ts b/plop/plopfile.ts index 9f8f1f74..3cb9b513 100644 --- a/plop/plopfile.ts +++ b/plop/plopfile.ts @@ -29,7 +29,6 @@ if (!existsSync(APPS_ROOT)) { } appsRoot(APPS_ROOT) -console.log({ APPS_ROOT }) export default async function (plop: NodePlopAPI) { plop.setHelper('stringify', function (context) { diff --git a/src/cli.ts b/src/cli.ts index aff39c75..1dd7c4cf 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -10,4 +10,7 @@ const main = async () => { } } -main().catch(console.error) +main().catch((e) => { + console.error(e) + process.exit(1) +}) diff --git a/src/util/getApp.ts b/src/util/getApp.ts index 1c3fde30..f1b809b3 100644 --- a/src/util/getApp.ts +++ b/src/util/getApp.ts @@ -1,3 +1,4 @@ +import { globSync } from 'glob' import { dirname, join } from 'path' import { fileURLToPath } from 'url' import type { AppInfo } from '../apps/' @@ -10,7 +11,8 @@ export const appsRoot = mkSetting(join(__dirname, `..`, `apps`)) export const getApp = async (slug: string) => { try { - console.log({ appsRoot: appsRoot() }) + console.log({ slug, appsRoot: appsRoot() }) + console.log(globSync(join(appsRoot()))) const path = join(appsRoot(), slug, 'index.js') const module = await import(path) return module[slug] as AppInfo