aboutsummaryrefslogtreecommitdiffstats
path: root/todo.go
diff options
context:
space:
mode:
Diffstat (limited to 'todo.go')
-rw-r--r--todo.go13
1 files changed, 2 insertions, 11 deletions
diff --git a/todo.go b/todo.go
index b71d215..2b95c98 100644
--- a/todo.go
+++ b/todo.go
@@ -128,22 +128,13 @@ func routeInput(command string, input string) {
case "init":
app.InitializeRepo()
case "web":
- // Only open default browser if .todos.json exists
- pwd, err := os.Getwd()
- if err != nil {
- fmt.Println(err)
+ if err := app.Load(); err != nil {
os.Exit(1)
- }
-
- if _, err := os.Stat(pwd + "/.todos.json"); err == nil {
+ } else {
web := todolist.NewWebapp()
fmt.Println("Now serving todolist web.\nHead to http://localhost:7890 to see your todo list!")
open.Start("http://localhost:7890")
web.Run()
- } else {
- fmt.Println("No todo file found!")
- fmt.Println("Initialize a new todo repo by running 'todo init'")
- os.Exit(1)
}
}
}