(path: string | undefined, options: InspectOptions)
| 35 | } |
| 36 | |
| 37 | async function inspectDeepnoteFile(path: string | undefined, options: InspectOptions): Promise<void> { |
| 38 | const { absolutePath } = await resolvePathToDeepnoteFile(path) |
| 39 | |
| 40 | debug('Reading file contents...') |
| 41 | const rawBytes = await fs.readFile(absolutePath) |
| 42 | const yamlContent = decodeUtf8NoBom(rawBytes) |
| 43 | |
| 44 | debug('Parsing .deepnote file...') |
| 45 | const deepnoteFile = deserializeDeepnoteFile(yamlContent) |
| 46 | |
| 47 | if (options.output === 'json') { |
| 48 | outputInspectJson(absolutePath, deepnoteFile) |
| 49 | } else if (options.output === 'toon') { |
| 50 | outputInspectToon(absolutePath, deepnoteFile) |
| 51 | } else { |
| 52 | printDeepnoteFileMetadata(absolutePath, deepnoteFile) |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * Build inspect result data structure for machine-readable output. |
no test coverage detected