github.com/dnephin/dobi@v0.15.0/tasks/alias/alias.go (about)

     1  package alias
     2  
     3  import (
     4  	"github.com/dnephin/dobi/config"
     5  	"github.com/dnephin/dobi/logging"
     6  	"github.com/dnephin/dobi/tasks/context"
     7  	"github.com/dnephin/dobi/tasks/task"
     8  	"github.com/dnephin/dobi/tasks/types"
     9  )
    10  
    11  // Task is an alias task
    12  type Task struct {
    13  	types.NoStop
    14  	name   task.Name
    15  	config *config.AliasConfig
    16  }
    17  
    18  // Name returns the name of the task
    19  func (t *Task) Name() task.Name {
    20  	return t.name
    21  }
    22  
    23  // Repr formats the task for logging
    24  func (t *Task) Repr() string {
    25  	return t.name.Format("alias")
    26  }
    27  
    28  // Run does nothing. Dependencies were already run.
    29  func (t *Task) Run(ctx *context.ExecuteContext, depsModified bool) (bool, error) {
    30  	logging.ForTask(t).Info("Done")
    31  	return depsModified, nil
    32  }