37 lines
850 B
Go
37 lines
850 B
Go
|
package tasks
|
||
|
|
||
|
import (
|
||
|
"ocl/portainer-devtool/configs"
|
||
|
"ocl/portainer-devtool/repositories/unpacker"
|
||
|
"ocl/portainer-devtool/tasks/common"
|
||
|
)
|
||
|
|
||
|
type ListRepoActionsSubTask struct {
|
||
|
Config *configs.Config
|
||
|
ParentTasks []common.Tasker
|
||
|
}
|
||
|
|
||
|
func NewListRepoActionsSubTask(cfg *configs.Config) *ListRepoActionsSubTask {
|
||
|
return &ListRepoActionsSubTask{
|
||
|
Config: cfg,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func (task *ListRepoActionsSubTask) Execute() error {
|
||
|
subTaskItems := []common.Tasker{
|
||
|
unpacker.NewBuildDockerImageSubTask(task.Config),
|
||
|
}
|
||
|
|
||
|
common.ListCommandMenu(subTaskItems, "Which management commands do you want to choose:", false, task.ParentTasks)
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
func (task *ListRepoActionsSubTask) SetParentTaskers(tasks []common.Tasker) {
|
||
|
task.ParentTasks = tasks
|
||
|
}
|
||
|
|
||
|
func (task *ListRepoActionsSubTask) String() string {
|
||
|
return "Choose Repository Commands"
|
||
|
}
|