(repo: Repo)
| 103 | } |
| 104 | |
| 105 | export const getRepoPath = (repo: Repo): { path: string, isReadOnly: boolean } => { |
| 106 | // If we are dealing with a local repository, then use that as the path. |
| 107 | // Mark as read-only since we aren't guaranteed to have write access to the local filesystem. |
| 108 | const cloneUrl = new URL(repo.cloneUrl); |
| 109 | if (repo.external_codeHostType === 'genericGitHost' && cloneUrl.protocol === 'file:') { |
| 110 | return { |
| 111 | path: cloneUrl.pathname, |
| 112 | isReadOnly: true, |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | const reposPath = path.join(env.DATA_CACHE_DIR, 'repos'); |
| 117 | |
| 118 | return { |
| 119 | path: path.join(reposPath, repo.id.toString()), |
| 120 | isReadOnly: false, |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | export const isCredentialsLoginEnabled = (org: Org): boolean => { |
| 125 | if (env.AUTH_CREDENTIALS_LOGIN_ENABLED !== undefined) { |
no outgoing calls
no test coverage detected