| 52 | }; |
| 53 | |
| 54 | const callback = (dat: string) => { |
| 55 | const outputUrl = re.exec(dat)?.[0]?.replace(re, '$1'); |
| 56 | if (!outputUrl) { |
| 57 | return false; |
| 58 | } |
| 59 | if (openOutfile) { |
| 60 | const outFile = vscode.Uri.file(outputUrl); |
| 61 | if (fs.existsSync(outFile.fsPath)) { |
| 62 | void vscode.commands.executeCommand('vscode.open', outFile); |
| 63 | } else { |
| 64 | void vscode.window.showWarningMessage(`Could not find the output file at path: "${outFile.fsPath}"`); |
| 65 | } |
| 66 | } |
| 67 | return true; |
| 68 | }; |
| 69 | |
| 70 | if (util.config().get<boolean>('rmarkdown.knit.focusOutputChannel')) { |
| 71 | this.rMarkdownOutput.show(true); |