MCPcopy
hub / github.com/deepnote/deepnote / createDiffAction

Function createDiffAction

packages/cli/src/commands/diff.ts:58–80  ·  view source on GitHub ↗
(
  _program: Command
)

Source from the content-addressed store, hash-verified

56}
57
58export function createDiffAction(
59 _program: Command
60): (path1: string | undefined, path2: string | undefined, options: DiffOptions) => Promise<void> {
61 return async (path1, path2, options) => {
62 try {
63 debug(`Diffing files: ${path1} vs ${path2}`)
64 debug(`Options: ${JSON.stringify(options)}`)
65 await diffDeepnoteFiles(path1, path2, options)
66 } catch (error) {
67 const message = error instanceof Error ? error.message : String(error)
68 const exitCode = error instanceof FileResolutionError ? ExitCode.InvalidUsage : ExitCode.Error
69 switch (options.output) {
70 case 'json':
71 outputJson({ success: false, error: message })
72 break
73 case undefined:
74 logError(message)
75 break
76 }
77 process.exit(exitCode)
78 }
79 }
80}
81
82async function diffDeepnoteFiles(
83 path1: string | undefined,

Callers 2

registerCommandsFunction · 0.90
diff.test.tsFile · 0.90

Calls 3

debugFunction · 0.90
outputJsonFunction · 0.90
diffDeepnoteFilesFunction · 0.85

Tested by

no test coverage detected