mirror of
https://github.com/go-task/task.git
synced 2026-06-11 09:51:50 +00:00
feat: remove entrypoint from the executor
This commit is contained in:
@@ -120,7 +120,6 @@ func run() error {
|
||||
flags.Entrypoint,
|
||||
flags.Dir,
|
||||
flags.Insecure,
|
||||
flags.Timeout,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
16
executor.go
16
executor.go
@@ -27,7 +27,6 @@ type (
|
||||
Executor struct {
|
||||
// Flags
|
||||
Dir string
|
||||
Entrypoint string
|
||||
TempDir *TempDir
|
||||
Force bool
|
||||
ForceAll bool
|
||||
@@ -123,21 +122,6 @@ func (o *dirOption) ApplyToExecutor(e *Executor) {
|
||||
e.Dir = o.dir
|
||||
}
|
||||
|
||||
// WithEntrypoint sets the entrypoint (main Taskfile) of the [Executor]. By
|
||||
// default, Task will search for one of the default Taskfiles in the given
|
||||
// directory.
|
||||
func WithEntrypoint(entrypoint string) ExecutorOption {
|
||||
return &entrypointOption{entrypoint}
|
||||
}
|
||||
|
||||
type entrypointOption struct {
|
||||
entrypoint string
|
||||
}
|
||||
|
||||
func (o *entrypointOption) ApplyToExecutor(e *Executor) {
|
||||
e.Entrypoint = o.entrypoint
|
||||
}
|
||||
|
||||
// WithTempDir sets the temporary directory that will be used by [Executor] for
|
||||
// storing temporary files like checksums and cached remote files. By default,
|
||||
// the temporary directory is set to the user's temporary directory.
|
||||
|
||||
@@ -105,7 +105,7 @@ func (e *Executor) setupCompiler() error {
|
||||
|
||||
e.Compiler = &Compiler{
|
||||
Dir: e.Dir,
|
||||
Entrypoint: e.Entrypoint,
|
||||
Entrypoint: e.Taskfile.Location,
|
||||
UserWorkingDir: e.UserWorkingDir,
|
||||
TaskfileEnv: e.Taskfile.Env,
|
||||
TaskfileVars: e.Taskfile.Vars,
|
||||
|
||||
@@ -229,7 +229,6 @@ func (o *flagsOption) ApplyToExecutor(e *task.Executor) {
|
||||
|
||||
e.Options(
|
||||
task.WithDir(dir),
|
||||
task.WithEntrypoint(Entrypoint),
|
||||
task.WithForce(Force),
|
||||
task.WithForceAll(ForceAll),
|
||||
task.WithWatch(Watch),
|
||||
|
||||
@@ -3,7 +3,6 @@ package taskfile
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
giturls "github.com/chainguard-dev/git-urls"
|
||||
|
||||
@@ -33,7 +32,6 @@ func NewRootNode(
|
||||
entrypoint string,
|
||||
dir string,
|
||||
insecure bool,
|
||||
timeout time.Duration,
|
||||
) (Node, error) {
|
||||
dir = fsext.DefaultDir(entrypoint, dir)
|
||||
// If the entrypoint is "-", we read from stdin
|
||||
|
||||
Reference in New Issue
Block a user