| 372 | } |
| 373 | |
| 374 | function parseRepositoryPath(repository: string): { |
| 375 | readonly namespacePath: string | null; |
| 376 | readonly projectPath: string; |
| 377 | } { |
| 378 | const parts: Array<string> = []; |
| 379 | for (const part of repository.split("/")) { |
| 380 | const trimmed = part.trim(); |
| 381 | if (trimmed.length > 0) { |
| 382 | parts.push(trimmed); |
| 383 | } |
| 384 | } |
| 385 | const projectPath = parts.at(-1) ?? repository.trim(); |
| 386 | const namespacePath = parts.length > 1 ? parts.slice(0, -1).join("/") : null; |
| 387 | return { namespacePath, projectPath }; |
| 388 | } |
| 389 | |
| 390 | export const make = Effect.gen(function* () { |
| 391 | const process = yield* VcsProcess.VcsProcess; |