use proper cwd
This commit is contained in:
parent
f6da338b46
commit
4ff0727006
|
|
@ -198,13 +198,13 @@ export class Hype<
|
||||||
const pageName = (c.req.param('page') ?? 'index').replace('.', '')
|
const pageName = (c.req.param('page') ?? 'index').replace('.', '')
|
||||||
if (pageName.startsWith('_')) return render404(c)
|
if (pageName.startsWith('_')) return render404(c)
|
||||||
|
|
||||||
const path = join(process.env.PWD ?? '.', `./src/pages/${pageName}.tsx`)
|
const path = join(process.cwd(), `./src/pages/${pageName}.tsx`)
|
||||||
|
|
||||||
if (!(await Bun.file(path).exists()))
|
if (!(await Bun.file(path).exists()))
|
||||||
return render404(c)
|
return render404(c)
|
||||||
|
|
||||||
let Layout = defaultLayout
|
let Layout = defaultLayout
|
||||||
const layoutPath = join(process.env.PWD ?? '.', `./src/pages/_layout.tsx`)
|
const layoutPath = join(process.cwd(), `./src/pages/_layout.tsx`)
|
||||||
if (await Bun.file(layoutPath).exists()) {
|
if (await Bun.file(layoutPath).exists()) {
|
||||||
Layout = pageCache.get(layoutPath)
|
Layout = pageCache.get(layoutPath)
|
||||||
if (!Layout) {
|
if (!Layout) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user