(value, optionName)
| 119 | } |
| 120 | |
| 121 | function parsePositiveInt(value, optionName) { |
| 122 | const parsed = Number.parseInt(value, 10); |
| 123 | if (!Number.isFinite(parsed) || parsed <= 0) { |
| 124 | throw new Error(`${optionName} must be a positive integer`); |
| 125 | } |
| 126 | return parsed; |
| 127 | } |
| 128 | |
| 129 | function loadEnv(envFile) { |
| 130 | if (!fs.existsSync(envFile)) { |