()
| 33 | const DRY_RUN = process.argv.includes('--dry-run') |
| 34 | |
| 35 | function parseMapArgs(): Record<string, string> { |
| 36 | const mapping: Record<string, string> = {} |
| 37 | const args = process.argv.slice(2) |
| 38 | for (let i = 0; i < args.length; i++) { |
| 39 | if (args[i] === '--map' && args[i + 1]) { |
| 40 | const [blockType, providerId] = args[i + 1].split('=') |
| 41 | if (blockType && providerId) { |
| 42 | mapping[blockType] = providerId |
| 43 | } else { |
| 44 | console.error( |
| 45 | `Invalid --map value: "${args[i + 1]}". Expected format: blockType=providerId` |
| 46 | ) |
| 47 | process.exit(1) |
| 48 | } |
| 49 | i++ |
| 50 | } |
| 51 | } |
| 52 | return mapping |
| 53 | } |
| 54 | |
| 55 | const BLOCK_TYPE_TO_PROVIDER = parseMapArgs() |
| 56 | if (Object.keys(BLOCK_TYPE_TO_PROVIDER).length === 0) { |
no test coverage detected