MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / getRepoIdFromPath

Function getRepoIdFromPath

packages/shared/src/utils.ts:100–103  ·  view source on GitHub ↗
(repoPath: string)

Source from the content-addressed store, hash-verified

98}
99
100export const getRepoIdFromPath = (repoPath: string): number | undefined => {
101 const id = parseInt(path.basename(repoPath), 10);
102 return isNaN(id) ? undefined : id;
103}
104
105export const getRepoPath = (repo: Repo): { path: string, isReadOnly: boolean } => {
106 // If we are dealing with a local repository, then use that as the path.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected