* Writes the component status to the given file.
()
| 84 | * Writes the component status to the given file. |
| 85 | */ |
| 86 | async function build() { |
| 87 | try { |
| 88 | const componentStatuses = await readFiles(sourceDirectory) |
| 89 | |
| 90 | if (!fs.existsSync(outputDir)) { |
| 91 | fs.mkdirSync(outputDir) |
| 92 | } |
| 93 | |
| 94 | fs.writeFileSync(`${outputDir}/component-status.json`, JSON.stringify(componentStatuses)) |
| 95 | } catch (error) { |
| 96 | throw new Error(`error building component status object: ${error}`) |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | build() |