reduce deps
This commit is contained in:
@@ -7,8 +7,7 @@ import (
|
|||||||
"math/rand"
|
"math/rand"
|
||||||
|
|
||||||
"github.com/LazyBachelor/LazyPM/cmd/pm/tasks"
|
"github.com/LazyBachelor/LazyPM/cmd/pm/tasks"
|
||||||
survey "github.com/LazyBachelor/LazyPM/internal/commands/survey"
|
"github.com/LazyBachelor/LazyPM/internal/commands/survey"
|
||||||
"github.com/LazyBachelor/LazyPM/internal/models"
|
|
||||||
"github.com/LazyBachelor/LazyPM/pkg/task"
|
"github.com/LazyBachelor/LazyPM/pkg/task"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
@@ -61,7 +60,7 @@ func runStartCmd(cmd *cobra.Command, args []string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func taskLoop(ctx context.Context, application *models.App, surveyTasks map[string]task.Tasker, interfaces map[string]task.Interface) error {
|
func taskLoop(ctx context.Context, application *task.App, surveyTasks map[string]task.Tasker, interfaces map[string]task.Interface) error {
|
||||||
var iNames []string
|
var iNames []string
|
||||||
for name := range interfaces {
|
for name := range interfaces {
|
||||||
iNames = append(iNames, name)
|
iNames = append(iNames, name)
|
||||||
@@ -93,7 +92,7 @@ func taskLoop(ctx context.Context, application *models.App, surveyTasks map[stri
|
|||||||
}
|
}
|
||||||
|
|
||||||
func returnIfUserQuit(err error, msg string) error {
|
func returnIfUserQuit(err error, msg string) error {
|
||||||
if errors.Is(err, models.ErrUserQuit) {
|
if errors.Is(err, task.ErrUserQuit) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return fmt.Errorf("%s: %w", msg, err)
|
return fmt.Errorf("%s: %w", msg, err)
|
||||||
|
|||||||
@@ -117,13 +117,13 @@ func TUIQuestion(interfaceType InterfaceType, fields ...huh.Field) *huh.Group {
|
|||||||
|
|
||||||
// FetchIssues retrieves all issues from the app and returns those that are relevant for validation,
|
// FetchIssues retrieves all issues from the app and returns those that are relevant for validation,
|
||||||
// excluding the setup issue. It also updates the setup issue with the latest data from the app.
|
// excluding the setup issue. It also updates the setup issue with the latest data from the app.
|
||||||
func FetchIssues(ctx context.Context, app *app.App, setupIssue *models.Issue) ([]*models.Issue, error) {
|
func FetchIssues(ctx context.Context, app *App, setupIssue *Issue) ([]*Issue, error) {
|
||||||
issues, err := app.Issues.SearchIssues(ctx, "", models.IssueFilter{})
|
issues, err := app.Issues.SearchIssues(ctx, "", models.IssueFilter{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var relevantIssues []*models.Issue
|
var relevantIssues []*Issue
|
||||||
for _, issue := range issues {
|
for _, issue := range issues {
|
||||||
if issue.ID != setupIssue.ID {
|
if issue.ID != setupIssue.ID {
|
||||||
relevantIssues = append(relevantIssues, issue)
|
relevantIssues = append(relevantIssues, issue)
|
||||||
|
|||||||
Reference in New Issue
Block a user