( _program: Command )
| 21 | * Creates the stats action - displays statistics about a .deepnote file. |
| 22 | */ |
| 23 | export function createStatsAction( |
| 24 | _program: Command |
| 25 | ): (path: string | undefined, options: StatsOptions) => Promise<void> { |
| 26 | return async (path, options) => { |
| 27 | try { |
| 28 | debug(`Analyzing stats for: ${path}`) |
| 29 | const stats = await computeStats(path, options) |
| 30 | outputStats(stats, options) |
| 31 | } catch (error) { |
| 32 | handleError(error, options) |
| 33 | } |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | async function computeStats(path: string | undefined, options: StatsOptions): Promise<StatsFileResult> { |
| 38 | const { absolutePath } = await resolvePathToDeepnoteFile(path) |
no test coverage detected