UNPKG

morphbox

Version:

Docker-based AI sandbox for development with Claude integration

25 lines (22 loc) 707 B
import { j as json } from './index-3BbzJtgI.js'; import { exec } from 'child_process'; import { promisify } from 'util'; const execAsync = promisify(exec); const POST = async ({ request }) => { try { const { branch } = await request.json(); if (!branch) { return json({ error: "Branch name is required" }, { status: 400 }); } await execAsync(`git checkout "${branch}"`); return json({ success: true }); } catch (error) { console.error("Git checkout error:", error); return json({ error: "Failed to checkout branch", message: error.message || "Unknown error" }, { status: 500 }); } }; export { POST }; //# sourceMappingURL=_server.ts-Vjb8FL_F.js.map