From 08bfbb5ba4be9bf936c86c8cfd38cfe9835a13d4 Mon Sep 17 00:00:00 2001 From: Quey-Liang Kao Date: Sat, 4 Feb 2017 20:58:16 +0800 Subject: Global repo file as the default This patch implments the new workflow mentioned in #31, in which the program still tries to find a repo file in the working directory first, and it tries the global one in the home directory if no one is found. In this patch, the condition check of the existence of the repo file is done in `todolist/file_store.go` at the very early step before the input routing. --- todo.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'todo.go') diff --git a/todo.go b/todo.go index 2a45f28..f7d994d 100644 --- a/todo.go +++ b/todo.go @@ -110,6 +110,10 @@ func usage() { func routeInput(command string, input string) { app := todolist.NewApp() + if app == nil { + return + } + switch command { case "l", "list", "agenda": app.ListTodos(input) -- cgit v1.3