diff options
| author | Bunchhieng <Bunchhieng@gmail.com> | 2016-09-15 10:13:42 -0400 |
|---|---|---|
| committer | Bunchhieng <Bunchhieng@gmail.com> | 2016-09-15 10:13:42 -0400 |
| commit | c94956df1ca37f90a42b5f66ccb63213253e4d3e (patch) | |
| tree | e52b21e8c89f0309e45408e81bf57578643bc350 /todo.go | |
| parent | aa0580af8066b030c720a20b5e79e98a53d1ec11 (diff) | |
Refactored code
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() + } } } |
