Download src/utils/get-git-path.ts from SaylorTwift/openhands: direct link, hf CLI and curl.
- Browser
- Download file 511 Bytes
-
https://huggingface.co/SaylorTwift/openhands/resolve/main/src/utils/get-git-path.ts
- Command line
-
hf download hf://SaylorTwift/openhands/src/utils/get-git-path.ts
-
curl -L -o get-git-path.ts https://huggingface.co/SaylorTwift/openhands/resolve/main/src/utils/get-git-path.ts
511 Bytes
| import { DEFAULT_WORKING_DIR } from "#/api/agent-server-config"; | |
| export function getGitPath( | |
| selectedRepository: string | null | undefined, | |
| workingDir?: string | null, | |
| ): string { | |
| const normalizedWorkingDir = workingDir?.trim(); | |
| if (normalizedWorkingDir) { | |
| return normalizedWorkingDir; | |
| } | |
| if (!selectedRepository) { | |
| return DEFAULT_WORKING_DIR; | |
| } | |
| const parts = selectedRepository.split("/"); | |
| const repoName = parts[parts.length - 1]; | |
| return `${DEFAULT_WORKING_DIR}/${repoName}`; | |
| } | |