diff options
| author | Grant Ammons <grant@pipelinedealsco.com> | 2016-09-19 05:27:44 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-09-19 05:27:44 -0400 |
| commit | c3c8817de6228557ba865465e3d639a104578587 (patch) | |
| tree | b5e004011606f1cc44eba196bff8f1bd33e795b7 /todo.go | |
| parent | aa0580af8066b030c720a20b5e79e98a53d1ec11 (diff) | |
| parent | 144ac3243b4920d267f224732d9deff0f9f2cc52 (diff) | |
Merge pull request #9 from Bunchhieng/master
Only allow to open web app if .todos.json exists in current directory
Diffstat (limited to 'todo.go')
| -rw-r--r-- | todo.go | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -128,9 +128,13 @@ func routeInput(command string, input string) { case "init": app.InitializeRepo() case "web": - 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() + if err := app.Load(); err != nil { + os.Exit(1) + } 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() + } } } |
