LaunchEditorWithTemplate will launch an editor as LaunchEditor do, but with a provided template.
(repo repository.RepoCommonStorage, fileName string, template string)
| 21 | // LaunchEditorWithTemplate will launch an editor as LaunchEditor do, but with a |
| 22 | // provided template. |
| 23 | func LaunchEditorWithTemplate(repo repository.RepoCommonStorage, fileName string, template string) (string, error) { |
| 24 | err := util.WriteFile(repo.LocalStorage(), fileName, []byte(template), 0644) |
| 25 | if err != nil { |
| 26 | return "", err |
| 27 | } |
| 28 | |
| 29 | return LaunchEditor(repo, fileName) |
| 30 | } |
| 31 | |
| 32 | // LaunchEditor launches the default editor configured for the given repo. This |
| 33 | // method blocks until the editor command has returned. |
no test coverage detected