MCPcopy Create free account
hub / github.com/amrkmn/x / parseTask

Function parseTask

scripts/task.ts:29–51  ·  view source on GitHub ↗
(args: string[])

Source from the content-addressed store, hash-verified

27 | 'cache:restore'
28 | 'cache:save'
29 | 'prepare-dist';
30
31export 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

Callers 1

runTaskFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected