(content, scope = "full")
| 151 | } |
| 152 | |
| 153 | function parseExampleEntries(content, scope = "full") { |
| 154 | const entries = new Map(); |
| 155 | const lines = content.split(/\r?\n/); |
| 156 | |
| 157 | if (scope === "oauth") { |
| 158 | let inOauthSection = false; |
| 159 | |
| 160 | for (const line of lines) { |
| 161 | const trimmed = line.trim(); |
| 162 | |
| 163 | if (/OAUTH PROVIDER CREDENTIALS/i.test(trimmed)) { |
| 164 | inOauthSection = true; |
| 165 | continue; |
| 166 | } |
| 167 | |
| 168 | if (!inOauthSection) continue; |
| 169 | |
| 170 | if (/Provider User-Agent Overrides/i.test(trimmed)) break; |
| 171 | |
| 172 | const parsed = parseEnvEntry(line); |
| 173 | if (!parsed) continue; |
| 174 | |
| 175 | const [key, value] = parsed; |
| 176 | entries.set(key, value); |
| 177 | } |
| 178 | |
| 179 | return entries; |
| 180 | } |
| 181 | |
| 182 | for (const line of lines) { |
| 183 | const parsed = parseEnvEntry(line); |
| 184 | if (!parsed) continue; |
| 185 | |
| 186 | const [key, value] = parsed; |
| 187 | entries.set(key, value); |
| 188 | } |
| 189 | |
| 190 | return entries; |
| 191 | } |
| 192 | |
| 193 | export function getEnvSyncPlan({ rootDir, scope = "full" } = {}) { |
| 194 | const root = resolveRootDir(rootDir); |
no test coverage detected