35 lines
747 B
Go
35 lines
747 B
Go
package tasks
|
|
|
|
import (
|
|
"ocl/portainer-devtool/configs"
|
|
"ocl/portainer-devtool/tasks/common"
|
|
)
|
|
|
|
type ListRepositoriesTask struct {
|
|
common.GeneralTask
|
|
}
|
|
|
|
func NewListRepositoriesTask(cfg *configs.Config) *ListRepositoriesTask {
|
|
return &ListRepositoriesTask{
|
|
GeneralTask: *common.NewGeneralTask(cfg),
|
|
}
|
|
}
|
|
|
|
func (task *ListRepositoriesTask) Execute() error {
|
|
subTaskItems := []common.Tasker{
|
|
NewListRepoActionsSubTask(task.Config),
|
|
}
|
|
|
|
for _, taskItem := range subTaskItems {
|
|
taskItem.SetParentTaskers(subTaskItems)
|
|
}
|
|
|
|
common.ListCommandMenu(subTaskItems, "Which management commands do you want to choose:", false, task.ParentTasks)
|
|
|
|
return nil
|
|
}
|
|
|
|
func (task *ListRepositoriesTask) String() string {
|
|
return "List All Repositories"
|
|
}
|