(path: string, identifier: string)
| 73 | * @returns file content |
| 74 | */ |
| 75 | export function getFileContent(path: string, identifier: string): string { |
| 76 | if (!fs.existsSync(path)) { |
| 77 | const err_msg = `${identifier} file ${path} is does not exist`; |
| 78 | throw new Error(err_msg); |
| 79 | } |
| 80 | |
| 81 | try { |
| 82 | return fs.readFileSync(path).toString(); |
| 83 | } catch (error) { |
| 84 | const err_msg = `Failed to load ${identifier} file, ${error}`; |
| 85 | throw new Error(err_msg); |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | // Validate generic/common section for project manifest |
| 90 | export function validateCommonProjectManifest(raw: unknown): void { |
no outgoing calls
no test coverage detected