forgot to commit this
This commit is contained in:
@@ -3,39 +3,16 @@ package main
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
"github.com/LazyBachelor/LazyPM/cmd/survey/tasks"
|
||||||
"github.com/LazyBachelor/LazyPM/internal/service"
|
"github.com/LazyBachelor/LazyPM/internal/service"
|
||||||
"github.com/LazyBachelor/LazyPM/pkg/cli/repl"
|
"github.com/LazyBachelor/LazyPM/pkg/repl"
|
||||||
"github.com/LazyBachelor/LazyPM/pkg/task"
|
"github.com/LazyBachelor/LazyPM/pkg/task"
|
||||||
"github.com/LazyBachelor/LazyPM/pkg/tui"
|
"github.com/LazyBachelor/LazyPM/pkg/tui"
|
||||||
"github.com/LazyBachelor/LazyPM/pkg/web"
|
"github.com/LazyBachelor/LazyPM/pkg/web"
|
||||||
|
|
||||||
"github.com/LazyBachelor/LazyPM/cmd/survey/tasks"
|
|
||||||
_ "github.com/LazyBachelor/LazyPM/cmd/survey/tasks"
|
_ "github.com/LazyBachelor/LazyPM/cmd/survey/tasks"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
|
||||||
task.Register("create_issue", func(app *service.App) task.Tasker {
|
|
||||||
return tasks.NewCreateIssueTask(app)
|
|
||||||
})
|
|
||||||
task.Register("coding_task", func(app *service.App) task.Tasker {
|
|
||||||
return tasks.NewCodingTask(app)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
func initTasks(app *service.App) []task.Tasker {
|
|
||||||
var taskers []task.Tasker
|
|
||||||
|
|
||||||
for _, name := range task.List() {
|
|
||||||
t, err := task.Get(name, app)
|
|
||||||
if err != nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
taskers = append(taskers, t)
|
|
||||||
}
|
|
||||||
|
|
||||||
return taskers
|
|
||||||
}
|
|
||||||
|
|
||||||
func initializeServices(ctx context.Context) (*service.App, func(), error) {
|
func initializeServices(ctx context.Context) (*service.App, func(), error) {
|
||||||
return service.NewServices(ctx, tasks.BaseConfig())
|
return service.NewServices(ctx, tasks.BaseConfig())
|
||||||
}
|
}
|
||||||
@@ -47,3 +24,17 @@ func initInterfaces() map[string]task.Interface {
|
|||||||
"web": web.NewWeb(),
|
"web": web.NewWeb(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func initTasks(app *service.App) []task.Tasker {
|
||||||
|
var taskList []task.Tasker
|
||||||
|
|
||||||
|
for _, name := range task.List() {
|
||||||
|
t, err := task.Get(name, app)
|
||||||
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
taskList = append(taskList, t)
|
||||||
|
}
|
||||||
|
|
||||||
|
return taskList
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user