From 7b47dbc0db6bdc1ca25951b8b580fd8950a513b3 Mon Sep 17 00:00:00 2001 From: Jersey Date: Fri, 26 Jun 2020 14:35:53 -0500 Subject: makes directory to new path --- plugin/bujo.vim | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/plugin/bujo.vim b/plugin/bujo.vim index e8b7077..537edb3 100644 --- a/plugin/bujo.vim +++ b/plugin/bujo.vim @@ -30,10 +30,10 @@ endfunction " GetToplevelFolder() gives us a clean name of the git repository that we are " currently working in function s:GetToplevelFolder() - let absolute_path = system("git rev-parse --show-toplevel") - let repo_name = split(absolute_path, "/") - let repo_name_clean = split(repo_name[-1], '\v\n')[0] - return repo_name_clean + let absolute_path = system("git rev-parse --show-toplevel") + let repo_name = split(absolute_path, "/") + let repo_name_clean = split(repo_name[-1], '\v\n')[0] + return repo_name_clean endfunction " OpenTodo() opens the respective todo.md file from $HOME/.cache/bujo @@ -46,7 +46,11 @@ function s:OpenTodo(...) exe ":30vs" . g:bujo#todo_file_path . "/todo.md" else let repo_name_clean = s:GetToplevelFolder() - exe ":30vs" . g:bujo#todo_file_path . "/" . repo_name_clean . "/todo.md" + let todo_path = g:bujo#todo_file_path . "/" . repo_name_clean + if empty(glob(todo_path)) + call mkdir(todo_path) + endif + exe ":30vs" . todo_path_c . "/todo.md" endif endfunction -- cgit v1.2.3 From 45265df1b75f25e54b67e4ab63f57cbfc1979963 Mon Sep 17 00:00:00 2001 From: Jersey Date: Fri, 26 Jun 2020 14:39:02 -0500 Subject: var wasnt named well --- plugin/bujo.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/bujo.vim b/plugin/bujo.vim index 537edb3..a2fa976 100644 --- a/plugin/bujo.vim +++ b/plugin/bujo.vim @@ -50,7 +50,7 @@ function s:OpenTodo(...) if empty(glob(todo_path)) call mkdir(todo_path) endif - exe ":30vs" . todo_path_c . "/todo.md" + exe ":30vs" . todo_path . "/todo.md" endif endfunction -- cgit v1.2.3