(workspacePath: string)
| 107 | } |
| 108 | |
| 109 | async function hasLocalGitmodules(workspacePath: string): Promise<boolean> { |
| 110 | const gitmodulesPath = path.join(workspacePath, ".gitmodules"); |
| 111 | |
| 112 | try { |
| 113 | const stat = await fs.stat(gitmodulesPath); |
| 114 | if (stat.isDirectory()) { |
| 115 | throw new Error(`${gitmodulesPath} is a directory`); |
| 116 | } |
| 117 | return true; |
| 118 | } catch (error) { |
| 119 | if (hasErrorCode(error, "ENOENT")) { |
| 120 | return false; |
| 121 | } |
| 122 | |
| 123 | throw formatGitmodulesProbeError(error); |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | async function hasRuntimeGitmodules(args: RuntimeSubmoduleSyncArgs): Promise<boolean> { |
| 128 | const env = buildGitExecutionEnv({ env: args.env, trusted: args.trusted }); |
no test coverage detected