1 | import { ChildProcess } from 'child_process';
|
2 |
|
3 | const EMPTY_STRING = '';
|
4 |
|
5 | export interface Project
|
6 | {
|
7 | name: string
|
8 |
|
9 | cwd: string;
|
10 |
|
11 | command: string;
|
12 |
|
13 | args?: string[];
|
14 |
|
15 | enabled?: boolean;
|
16 |
|
17 | delay?: number;
|
18 |
|
19 | currentProcess?: ChildProcess;
|
20 | }
|
21 |
|
22 | export interface Play
|
23 | {
|
24 | name: string;
|
25 | projects?: Project[];
|
26 | }
|
27 |
|
28 | export interface ProjectHandler
|
29 | {
|
30 | name: string;
|
31 |
|
32 | desc: string;
|
33 |
|
34 | files: string[];
|
35 |
|
36 | |
37 |
|
38 |
|
39 | extract(path: string, content: string): Project[];
|
40 | }
|
41 |
|
42 | export function playToString(play: Play): string {
|
43 | if (!play) return EMPTY_STRING;
|
44 | return `${play.name} (${(play.projects || []).length})`;
|
45 | } |
\ | No newline at end of file |