MCPcopy Index your code
hub / github.com/deepnote/deepnote / inspectDeepnoteFile

Function inspectDeepnoteFile

packages/cli/src/commands/inspect.ts:37–54  ·  view source on GitHub ↗
(path: string | undefined, options: InspectOptions)

Source from the content-addressed store, hash-verified

35}
36
37async 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.

Callers 1

createInspectActionFunction · 0.85

Calls 7

debugFunction · 0.90
decodeUtf8NoBomFunction · 0.90
deserializeDeepnoteFileFunction · 0.90
outputInspectJsonFunction · 0.85
outputInspectToonFunction · 0.85

Tested by

no test coverage detected