This commit is contained in:
+1
-1
@@ -53,7 +53,7 @@ export async function listProjects() {
|
||||
|
||||
export async function createProject(input: { name?: string; template?: string }) {
|
||||
const template = input.template || "basic";
|
||||
const templateRoot = path.join(TEMPLATES_ROOT, template);
|
||||
const templateRoot = path.join(/* turbopackIgnore: true */ TEMPLATES_ROOT, template);
|
||||
await fs.access(templateRoot);
|
||||
const slug = (input.name || "新小工具").toLowerCase().replace(/[^a-z0-9\u4e00-\u9fff]+/g, "-").replace(/^-|-$/g, "").slice(0, 28) || "tool";
|
||||
const id = `${slug}-${crypto.randomBytes(3).toString("hex")}`;
|
||||
|
||||
Reference in New Issue
Block a user