()
| 2 | import { getConfig } from './config' |
| 3 | |
| 4 | export const parseCliConfig = async () => { |
| 5 | const args = process.argv |
| 6 | const resultsPath = args[2] |
| 7 | if (!resultsPath) { |
| 8 | logger.error(`no survey results path provided`) |
| 9 | await flushLogs() |
| 10 | process.exit(1) |
| 11 | } |
| 12 | |
| 13 | const outputDir = args[3] |
| 14 | if (!outputDir) { |
| 15 | logger.error(`no output directory provided`) |
| 16 | await flushLogs() |
| 17 | process.exit(1) |
| 18 | } |
| 19 | |
| 20 | const startFromLocale = args[4] |
| 21 | |
| 22 | return getConfig(resultsPath, outputDir, startFromLocale) |
| 23 | } |