mirror of
https://github.com/go-task/task.git
synced 2026-06-24 13:15:51 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8545d4c61 | ||
|
|
9b42ef5d46 | ||
|
|
05ddfc0495 | ||
|
|
53b2cebb66 | ||
|
|
837fb71a24 | ||
|
|
2e13cf5f74 | ||
|
|
0ae1681d9c |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -19,8 +19,9 @@ dist/
|
|||||||
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
# intellij idea/goland
|
# editors
|
||||||
.idea/
|
.idea/
|
||||||
|
.vscode/
|
||||||
|
|
||||||
# exuberant ctags
|
# exuberant ctags
|
||||||
tags
|
tags
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
build:
|
build:
|
||||||
binary: task
|
binary: task
|
||||||
main: cmd/task/task.go
|
main: cmd/task
|
||||||
goos:
|
goos:
|
||||||
- windows
|
- windows
|
||||||
- darwin
|
- darwin
|
||||||
@@ -17,6 +17,11 @@ build:
|
|||||||
goarch: 386
|
goarch: 386
|
||||||
env:
|
env:
|
||||||
- CGO_ENABLED=0
|
- CGO_ENABLED=0
|
||||||
|
ldflags:
|
||||||
|
- -s -w # Don't set main.version.
|
||||||
|
|
||||||
|
gomod:
|
||||||
|
proxy: true
|
||||||
|
|
||||||
archives:
|
archives:
|
||||||
- name_template: "{{.Binary}}_{{.Os}}_{{.Arch}}"
|
- name_template: "{{.Binary}}_{{.Os}}_{{.Arch}}"
|
||||||
|
|||||||
15
CHANGELOG.md
15
CHANGELOG.md
@@ -1,13 +1,22 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v3.4.2 - 2021-04-23
|
||||||
|
|
||||||
|
- On watch, report which file failed to read
|
||||||
|
([#472](https://github.com/go-task/task/pull/472)).
|
||||||
|
- Do not try to catch SIGKILL signal, which are not actually possible
|
||||||
|
([#476](https://github.com/go-task/task/pull/476)).
|
||||||
|
- Improve version reporting when building Task from source using Go Modules
|
||||||
|
([#462](https://github.com/go-task/task/pull/462), [#473](https://github.com/go-task/task/pull/473)).
|
||||||
|
|
||||||
## v3.4.1 - 2021-04-17
|
## v3.4.1 - 2021-04-17
|
||||||
|
|
||||||
- Improve error reporting when parsing YAML: in some situations where you
|
- Improve error reporting when parsing YAML: in some situations where you
|
||||||
would just see an generic error, you'll now see the actual error with
|
would just see an generic error, you'll now see the actual error with
|
||||||
more detail: the YAML line the failed to parse, for exemple
|
more detail: the YAML line the failed to parse, for example
|
||||||
[#467](https://github.com/go-task/task/issues/467).
|
([#467](https://github.com/go-task/task/issues/467)).
|
||||||
- A JSON Schema was published [here](https://json.schemastore.org/taskfile.json)
|
- A JSON Schema was published [here](https://json.schemastore.org/taskfile.json)
|
||||||
- and is automatically being used by some editors like Visual Studio Code
|
and is automatically being used by some editors like Visual Studio Code
|
||||||
([#135](https://github.com/go-task/task/issues/135)).
|
([#135](https://github.com/go-task/task/issues/135)).
|
||||||
- Print task name before the command in the log output
|
- Print task name before the command in the log output
|
||||||
([#398](https://github.com/go-task/task/pull/398)).
|
([#398](https://github.com/go-task/task/pull/398)).
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime/debug"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
@@ -19,7 +20,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
version = "master"
|
version = ""
|
||||||
)
|
)
|
||||||
|
|
||||||
const usage = `Usage: task [-ilfwvsd] [--init] [--list] [--force] [--watch] [--verbose] [--silent] [--dir] [--taskfile] [--dry] [--summary] [task...]
|
const usage = `Usage: task [-ilfwvsd] [--init] [--list] [--force] [--watch] [--verbose] [--silent] [--dir] [--taskfile] [--dry] [--summary] [task...]
|
||||||
@@ -93,7 +94,7 @@ func main() {
|
|||||||
pflag.Parse()
|
pflag.Parse()
|
||||||
|
|
||||||
if versionFlag {
|
if versionFlag {
|
||||||
fmt.Printf("Task version: %s\n", version)
|
fmt.Printf("Task version: %s\n", getVersion())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -208,7 +209,7 @@ func getArgs() (tasksAndVars, cliArgs []string) {
|
|||||||
|
|
||||||
func getSignalContext() context.Context {
|
func getSignalContext() context.Context {
|
||||||
ch := make(chan os.Signal, 1)
|
ch := make(chan os.Signal, 1)
|
||||||
signal.Notify(ch, os.Interrupt, os.Kill, syscall.SIGTERM)
|
signal.Notify(ch, os.Interrupt, syscall.SIGTERM)
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
go func() {
|
go func() {
|
||||||
sig := <-ch
|
sig := <-ch
|
||||||
@@ -217,3 +218,21 @@ func getSignalContext() context.Context {
|
|||||||
}()
|
}()
|
||||||
return ctx
|
return ctx
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getVersion() string {
|
||||||
|
if version != "" {
|
||||||
|
return version
|
||||||
|
}
|
||||||
|
|
||||||
|
info, ok := debug.ReadBuildInfo()
|
||||||
|
if !ok || info.Main.Version == "" {
|
||||||
|
return "unknown"
|
||||||
|
}
|
||||||
|
|
||||||
|
version = info.Main.Version
|
||||||
|
if info.Main.Sum != "" {
|
||||||
|
version += fmt.Sprintf(" (%s)", info.Main.Sum)
|
||||||
|
}
|
||||||
|
|
||||||
|
return version
|
||||||
|
}
|
||||||
|
|||||||
3
watch.go
3
watch.go
@@ -2,6 +2,7 @@ package task
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@@ -129,7 +130,7 @@ func (e *Executor) registerWatchedFiles(w *watcher.Watcher, calls ...taskfile.Ca
|
|||||||
for _, s := range task.Sources {
|
for _, s := range task.Sources {
|
||||||
files, err := zglob.Glob(s)
|
files, err := zglob.Glob(s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("task: %s: %w", s, err)
|
||||||
}
|
}
|
||||||
for _, f := range files {
|
for _, f := range files {
|
||||||
absFile, err := filepath.Abs(f)
|
absFile, err := filepath.Abs(f)
|
||||||
|
|||||||
Reference in New Issue
Block a user