Implemented check for EDITOR env variable

pull/17/head
マリウス 2 years ago
parent fbdefc7bc2
commit cb7453e5c1
No known key found for this signature in database
GPG Key ID: 272ED814BF63261F

@ -18,6 +18,10 @@ func MillisecondsToDate(ms int64) (string) {
}
func (t *TUI) OpenArticle(article *models.Article) (models.Article, error) {
if editor, exist := os.LookupEnv("EDITOR"); exist == false || editor == "" {
return *article, errors.New("EDITOR environment variable not available, please export!")
}
tmpFile, err := ioutil.TempFile(os.TempDir(), "article-*.txt")
if err != nil {
return *article, err

Loading…
Cancel
Save