| 27 | | 'cache:restore' |
| 28 | | 'cache:save' |
| 29 | | 'prepare-dist'; |
| 30 | |
| 31 | export function parseTask(args: string[]): TaskCommand { |
| 32 | if (args.includes('--generate-only')) return 'data'; |
| 33 | if (args.includes('--update-search')) return 'search'; |
| 34 | if (args.includes('--quick')) return 'check'; |
| 35 | if (args.includes('--sync')) return 'static'; |
| 36 | |
| 37 | const [command, subcommand] = args; |
| 38 | if (command === 'cache' && subcommand === 'restore') return 'cache:restore'; |
| 39 | if (command === 'cache' && subcommand === 'save') return 'cache:save'; |
| 40 | |
| 41 | if ( |
| 42 | command === 'check' || |
| 43 | command === 'static' || |
| 44 | command === 'full' || |
| 45 | command === 'data' || |
| 46 | command === 'search' || |
| 47 | command === 'prepare-dist' |
| 48 | ) { |
| 49 | return command; |
| 50 | } |
| 51 | |
| 52 | return 'full'; |
| 53 | } |
| 54 | |