(kernel: IKernel)
| 255 | } |
| 256 | |
| 257 | private async getCWD(kernel: IKernel) { |
| 258 | if (!kernel.session?.kernel) { |
| 259 | throw new SessionDisposedError(); |
| 260 | } |
| 261 | const outputs = await executeSilently(kernel.session.kernel, `import os;os.getcwd();`); |
| 262 | if (outputs.length === 0) { |
| 263 | return; |
| 264 | } |
| 265 | |
| 266 | const output: nbformat.IExecuteResult = outputs[0] as unknown as nbformat.IExecuteResult; |
| 267 | if (output.output_type !== 'execute_result') { |
| 268 | return undefined; |
| 269 | } |
| 270 | |
| 271 | return output.data['text/plain']; |
| 272 | } |
| 273 | } |
no test coverage detected