Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions apps/server/src/git/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ import { Schema } from "effect";
import { TextGenerationError } from "@t3tools/contracts";

import { existsSync } from "node:fs";
import { join } from "node:path";
import { dirname, join } from "node:path";

export function isGitRepository(cwd: string): boolean {
return existsSync(join(cwd, ".git"));
export function isGitRepository(current: string): boolean {
do {
if (existsSync(join(current, ".git"))) return true;
} while (current !== (current = dirname(current)));
return false;
}
Comment thread
macroscopeapp[bot] marked this conversation as resolved.

/** Convert an Effect Schema to a flat JSON Schema object, inlining `$defs` when present. */
Expand Down
Loading