(argv)
| 113 | } |
| 114 | |
| 115 | function parseArgs(argv) { |
| 116 | const options = {} |
| 117 | for (let i = 0; i < argv.length; i += 1) { |
| 118 | const arg = argv[i] |
| 119 | if (arg === '--source') { |
| 120 | options.source = argv[i + 1] |
| 121 | i += 1 |
| 122 | continue |
| 123 | } |
| 124 | if (arg === '--out') { |
| 125 | options.out = argv[i + 1] |
| 126 | i += 1 |
| 127 | continue |
| 128 | } |
| 129 | throw new Error(`Unknown argument: ${arg}`) |
| 130 | } |
| 131 | return options |
| 132 | } |
| 133 | |
| 134 | async function assertDirectory(dirPath) { |
| 135 | const stat = await fs.stat(dirPath) |
no outgoing calls
no test coverage detected