diff options
| author | Bunchhieng <Bunchhieng@gmail.com> | 2016-09-11 15:11:48 -0400 |
|---|---|---|
| committer | Bunchhieng <Bunchhieng@gmail.com> | 2016-09-11 15:11:48 -0400 |
| commit | 695c8ad53213041d9904ef2c8648ecc10df69f5e (patch) | |
| tree | 525e9234e9caad46c191ea878bb07228076fb154 /todo.go | |
| parent | e7eb2b8f8cee7ebdf170173617a699e2e023db9b (diff) | |
Only open browser if .todos.json exists
Diffstat (limited to 'todo.go')
| -rw-r--r-- | todo.go | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -130,11 +130,11 @@ func routeInput(command string, input string) { case "web": // Only open default browser if .todos.json exists pwd, err := os.Getwd() - if err != nil { - fmt.Println(err) - os.Exit(1) - } - + if err != nil { + fmt.Println(err) + os.Exit(1) + } + if _, err := os.Stat(pwd + "/.todos.json"); err == nil { web := todolist.NewWebapp() fmt.Println("Now serving todolist web.\nHead to http://localhost:7890 to see your todo list!") |
