()
| 37 | const RE_SUBMODULE_PATH = /path\s*=\s*(.+)/g |
| 38 | |
| 39 | function getExistingSubmodulePaths(): string[] { |
| 40 | const gitmodules = join(root, '.gitmodules') |
| 41 | if (!existsSync(gitmodules)) |
| 42 | return [] |
| 43 | const content = readFileSync(gitmodules, 'utf-8') |
| 44 | const matches = content.matchAll(RE_SUBMODULE_PATH) |
| 45 | return Array.from(matches, match => match[1].trim()) |
| 46 | } |
| 47 | |
| 48 | function removeSubmodule(submodulePath: string): void { |
| 49 | // Deinitialize the submodule |
no outgoing calls
no test coverage detected