This commit is contained in:
Martin Pander
2024-06-04 16:45:57 +02:00
parent 9aa7b04b98
commit 0572763e31
6 changed files with 38 additions and 18 deletions

13
main.go
View File

@ -15,7 +15,18 @@ import (
)
func main() {
ts := taskwarrior.NewTaskSquire("./test/taskrc")
var taskrcPath string
if taskrcEnv := os.Getenv("TASKRC"); taskrcEnv != "" {
taskrcPath = taskrcEnv
} else if _, err := os.Stat(os.Getenv("HOME") + "/.taskrc"); err == nil {
taskrcPath = os.Getenv("HOME") + "/.taskrc"
} else if _, err := os.Stat(os.Getenv("HOME") + "/.config/task/taskrc"); err == nil {
taskrcPath = os.Getenv("HOME") + "/.config/task/taskrc"
} else {
log.Fatal("Unable to find taskrc file")
}
ts := taskwarrior.NewTaskSquire(taskrcPath)
ctx := context.Background()
common := common.NewCommon(ctx, ts)