Skip to content

Commit 7473ac2

Browse files
authored
Fix restart-dev package.json check to use project dir (#167)
Co-authored-by: Chris Tate <ctate@users.noreply.github.com>
1 parent 0e0f832 commit 7473ac2

File tree

1 file changed

+2
-2
lines changed
  • app/api/tasks/[taskId]/restart-dev

1 file changed

+2
-2
lines changed

app/api/tasks/[taskId]/restart-dev/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { tasks } from '@/lib/db/schema'
44
import { eq } from 'drizzle-orm'
55
import { Sandbox } from '@vercel/sandbox'
66
import { getServerSession } from '@/lib/session/get-server-session'
7-
import { runCommandInSandbox, PROJECT_DIR } from '@/lib/sandbox/commands'
7+
import { runCommandInSandbox, runInProject, PROJECT_DIR } from '@/lib/sandbox/commands'
88
import { detectPackageManager } from '@/lib/sandbox/package-manager'
99
import { createTaskLogger } from '@/lib/utils/task-logger'
1010

@@ -45,7 +45,7 @@ export async function POST(_request: NextRequest, { params }: { params: Promise<
4545
const logger = createTaskLogger(taskId)
4646

4747
// Check if package.json exists and has a dev script
48-
const packageJsonCheck = await runCommandInSandbox(sandbox, 'test', ['-f', 'package.json'])
48+
const packageJsonCheck = await runInProject(sandbox, 'test', ['-f', 'package.json'])
4949
if (!packageJsonCheck.success) {
5050
return NextResponse.json({ error: 'No package.json found in sandbox' }, { status: 400 })
5151
}

0 commit comments

Comments
 (0)