(file: string, template: TemplateItem, cwd: string)
| 101 | } |
| 102 | |
| 103 | async function makeDraft(file: string, template: TemplateItem, cwd: string): Promise<string | undefined> { |
| 104 | const fileString = ToRStringLiteral(file, ''); |
| 105 | const cmd = `cat(normalizePath(rmarkdown::draft(file='${fileString}', template='${template.info.id}', package='${template.info.package}', edit=FALSE)))`; |
| 106 | return await executeRCommand(cmd, cwd, (e: Error) => { |
| 107 | void window.showErrorMessage(e.message); |
| 108 | return ''; |
| 109 | }); |
| 110 | } |
| 111 | |
| 112 | export async function newDraft(): Promise<void> { |
| 113 | const cwd = getCurrentWorkspaceFolder()?.uri.fsPath ?? os.homedir(); |
no test coverage detected