()
| 303 | } |
| 304 | |
| 305 | async function main() { |
| 306 | const [,, command] = process.argv; |
| 307 | switch (command) { |
| 308 | case 'update': { |
| 309 | return updateResource(); |
| 310 | } |
| 311 | case 'push': { |
| 312 | // Limit to languages changed in this PR only |
| 313 | const allowedLangs = await loadUpdatedLocales(); |
| 314 | return batchHandle(pushTranslations, allowedLangs); |
| 315 | } |
| 316 | case 'pull': { |
| 317 | return batchHandle(pullTranslations); |
| 318 | } |
| 319 | default: { |
| 320 | throw new Error(`Unknown command: ${command}`); |
| 321 | } |
| 322 | } |
| 323 | } |
| 324 | |
| 325 | main().catch(err => { |
| 326 | console.error(err); |
no test coverage detected