(path: string | undefined, options: OpenOptions)
| 31 | } |
| 32 | |
| 33 | async function openDeepnoteFile(path: string | undefined, options: OpenOptions): Promise<void> { |
| 34 | const { absolutePath } = await resolvePathToDeepnoteFile(path) |
| 35 | const c = getChalk() |
| 36 | const isJsonOutput = options.output === 'json' |
| 37 | |
| 38 | const result = await openDeepnoteFileInCloud(absolutePath, { |
| 39 | domain: options.domain, |
| 40 | quiet: isJsonOutput, |
| 41 | }) |
| 42 | |
| 43 | if (isJsonOutput) { |
| 44 | outputJson({ |
| 45 | success: true, |
| 46 | path: absolutePath, |
| 47 | url: result.url, |
| 48 | importId: result.importId, |
| 49 | }) |
| 50 | } else { |
| 51 | output(`${c.green('✓')} Opened in Deepnote`) |
| 52 | output(`${c.dim('URL:')} ${result.url}`) |
| 53 | } |
| 54 | } |
no test coverage detected