Skip to content

Commit 296d1c7

Browse files
committed
add repo url
1 parent 221174c commit 296d1c7

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

src/cli/handlers/init/index.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
getConfigFromWorkDir,
55
} from "../../middlewares/napiConfig.ts";
66
import { join, normalize, relative, SEPARATOR } from "@std/path";
7-
import type z from "zod";
7+
import z from "zod";
88
import type { localConfigSchema } from "../../middlewares/napiConfig.ts";
99
import pythonStdlibList from "../../../scripts/generate_python_stdlib_list/output.json" with {
1010
type: "json",
@@ -668,12 +668,25 @@ async function createNewProject(apiService: ApiService): Promise<number> {
668668
},
669669
});
670670

671+
const projectRepoUrl = await input({
672+
message: "Enter the URL of your project repository:",
673+
validate: (value) => {
674+
if (!value.trim()) return "Project repository URL cannot be empty";
675+
const result = z.string().url().safeParse(value);
676+
if (!result.success) {
677+
return result.error.message;
678+
}
679+
return true;
680+
},
681+
});
682+
671683
try {
672684
const createProjectResponse = await apiService.performRequest(
673685
"POST",
674686
"/projects",
675687
{
676688
name: projectName,
689+
repoUrl: projectRepoUrl,
677690
workspaceId: selectedWorkspaceId,
678691
maxCodeCharPerSymbol: 100,
679692
maxCodeCharPerFile: 1000,

0 commit comments

Comments
 (0)