(manifestDir: string, fileName?: string)
| 40 | } |
| 41 | |
| 42 | export function getSchemaPath(manifestDir: string, fileName?: string): string { |
| 43 | const rawProject = loadFromJsonOrYaml(getManifestPath(manifestDir, fileName)); |
| 44 | if ((rawProject as any).specVersion === '0.0.1') { |
| 45 | return path.join(manifestDir, (rawProject as any).schema); |
| 46 | } |
| 47 | const project = rawProject as ProjectManifestV1_0_0; |
| 48 | if (!project.schema) { |
| 49 | throw new Error(`Can't get schema in yaml file`); |
| 50 | } |
| 51 | if (!project.schema.file) { |
| 52 | throw new Error(`schemaPath expect to be schema.file`); |
| 53 | } |
| 54 | return path.join(manifestDir, project.schema.file); |
| 55 | } |
| 56 | |
| 57 | // Only work for manifest specVersion >= 1.0.0 |
| 58 | export function getProjectNetwork(rawManifest: unknown): NETWORK_FAMILY { |
no test coverage detected