Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
benallfree committed Apr 23, 2024
1 parent 0da0bba commit 6c5537a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 0 additions & 1 deletion plop/plopfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 4 additions & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ const main = async () => {
}
}

main().catch(console.error)
main().catch((e) => {
console.error(e)
process.exit(1)
})
4 changes: 3 additions & 1 deletion src/util/getApp.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { globSync } from 'glob'
import { dirname, join } from 'path'
import { fileURLToPath } from 'url'
import type { AppInfo } from '../apps/'
Expand All @@ -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
Expand Down

0 comments on commit 6c5537a

Please sign in to comment.