chore: update src/lib/repo-templates.ts

swadhinbiswas committed 8 months ago
87ba408
1 parent 93b5e3c
commit 87ba408
1 file changed
+2 -2
Showing 1 changed file+2-2
▼src/lib/repo-templates.ts
+2-2
3
3
* Handle creating repositories from templates
4
4
*/
5
5
6
+import crypto from "node:crypto";
6
7
import { getDatabase, schema } from "@/db";
7
8
import { eq } from "drizzle-orm";
8
9
import { logger } from "./logger";
9
10
import simpleGit from "simple-git";
10
11
import path from "path";
11
12
import fs from "fs/promises";
12
-import { v4 as uuidv4 } from "uuid";
13
13
import {
14
14
finalizeRepoInit,
15
15
getDiskPath,
60
60
return { success: false, error: "Repository is not marked as a template" };
61
61
}
62
62
63
- const newRepoId = uuidv4();
63
+ const newRepoId = crypto.randomUUID();
64
64
const newSlug = options.newName.toLowerCase().replace(/[^a-z0-9-]/g, "-");
65
65
const newDiskPath = options.diskPath || (await getDiskPath(options.newOwnerUsername, newSlug));
66
66
67
67