From 005b6388ae58f2a71edcc1ae068bfc48795fcdbe Mon Sep 17 00:00:00 2001 From: Volodymyr Patuta <6977238-fiplox@users.noreply.gitlab.com> Date: Fri, 27 Nov 2020 15:11:36 +0100 Subject: [PATCH] filename with extension .md --- src/notes.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/notes.rs b/src/notes.rs index 8811e78..1d98b6b 100644 --- a/src/notes.rs +++ b/src/notes.rs @@ -28,8 +28,8 @@ pub fn create_dir(category: &str) -> Result<()> { pub fn create_note(header: &str, category: &str) -> Result<()> { let editor = env::var("EDITOR").unwrap_or("/bin/vi".to_owned()); - let path = format!("{}{}", get_path(category)?, header); + let file = format!("{}{}.md", get_path(category)?, header); // TODO: check if duplicate - Command::new(editor).arg(&path).status()?; + Command::new(editor).arg(&file).status()?; Ok(()) }