(path: string)
| 19 | * @returns The converted DeepnoteFile with metadata about the conversion |
| 20 | */ |
| 21 | export async function resolveAndConvertToDeepnote(path: string): Promise<LoadedRunnableFile> { |
| 22 | const { absolutePath, isDirectory } = await resolvePath(path) |
| 23 | |
| 24 | if (isDirectory) { |
| 25 | throw new FileResolutionError( |
| 26 | 'Directory paths are not supported for run.\n\nProvide a path to a specific file (.deepnote, .ipynb, .py, .qmd).' |
| 27 | ) |
| 28 | } |
| 29 | |
| 30 | debug(`Resolved path for run: ${absolutePath}`) |
| 31 | |
| 32 | try { |
| 33 | return await loadRunnableFile(absolutePath) |
| 34 | } catch (error) { |
| 35 | if (error instanceof LoadRunnableFileError) { |
| 36 | throw new FileResolutionError(error.message) |
| 37 | } |
| 38 | throw error |
| 39 | } |
| 40 | } |
no test coverage detected