morphbox
Version:
Docker-based AI sandbox for development with Claude integration
25 lines (22 loc) • 696 B
JavaScript
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 { path } = await request.json();
if (!path) {
return json({ error: "Path is required" }, { status: 400 });
}
await execAsync(`git checkout -- "${path}"`);
return json({ success: true });
} catch (error) {
console.error("Git discard error:", error);
return json({
error: "Failed to discard changes",
message: error.message || "Unknown error"
}, { status: 500 });
}
};
export { POST };
//# sourceMappingURL=_server.ts-D1KPpkBv.js.map