mirror of
https://github.com/go-task/task.git
synced 2025-06-08 23:56:21 +02:00
commit
a3bfa13670
@ -14,14 +14,14 @@ var (
|
|||||||
version = "master"
|
version = "master"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
const usage = `Usage: task [-ifw] [--init] [--force] [--watch] [task...]
|
||||||
log.SetFlags(0)
|
|
||||||
|
|
||||||
pflag.Usage = func() {
|
Runs the specified task(s). Falls back to the "default" task if no task name
|
||||||
fmt.Println(`task [target1 target2 ...]: Runs commands under targets like make.
|
was specified, or lists all tasks if an unknown task name was specified.
|
||||||
|
|
||||||
|
Example: 'task hello' with the following 'Taskfile.yml' file will generate an
|
||||||
|
'output.txt' file with the content "hello".
|
||||||
|
|
||||||
Example: 'task hello' with the following 'Taskfile.yml' file will generate
|
|
||||||
an 'output.txt' file.
|
|
||||||
'''
|
'''
|
||||||
hello:
|
hello:
|
||||||
cmds:
|
cmds:
|
||||||
@ -30,7 +30,13 @@ hello:
|
|||||||
generates:
|
generates:
|
||||||
- output.txt
|
- output.txt
|
||||||
'''
|
'''
|
||||||
`)
|
`
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
log.SetFlags(0)
|
||||||
|
|
||||||
|
pflag.Usage = func() {
|
||||||
|
fmt.Println(usage)
|
||||||
pflag.PrintDefaults()
|
pflag.PrintDefaults()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
task.go
2
task.go
@ -249,8 +249,8 @@ func (e *Executor) runCommand(ctx context.Context, task string, i int) error {
|
|||||||
Stderr: e.Stderr,
|
Stderr: e.Stderr,
|
||||||
}
|
}
|
||||||
|
|
||||||
if t.Set == "" {
|
|
||||||
e.println(c)
|
e.println(c)
|
||||||
|
if t.Set == "" {
|
||||||
opts.Stdout = e.Stdout
|
opts.Stdout = e.Stdout
|
||||||
if err = execext.RunCommand(opts); err != nil {
|
if err = execext.RunCommand(opts); err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user