Skip to content

Commit 59a00ea

Browse files
committed
Merge branch 'master' into v3
2 parents 9f0f18c + df8293b commit 59a00ea

File tree

9 files changed

+56
-24
lines changed

9 files changed

+56
-24
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,16 @@
3636
commands are green, errors are red, etc
3737
([#207](https://github.com/go-task/task/pull/207)).
3838

39-
## Unreleased
39+
## v2.8.1 - 2019-05-20
4040

41+
- Fix error code for the `--help` flag
42+
([#300](https://github.com/go-task/task/issues/300), [#330](https://github.com/go-task/task/pull/330)).
43+
- Print version to stdout instead of stderr
44+
([#299](https://github.com/go-task/task/issues/299), [#329](https://github.com/go-task/task/pull/329)).
4145
- Supress `context` errors when using the `--watch` flag
4246
([#313](https://github.com/go-task/task/issues/313), [#317](https://github.com/go-task/task/pull/317)).
47+
- Support templating on description
48+
([#276](https://github.com/go-task/task/issues/276), [#283](https://github.com/go-task/task/pull/283)).
4349

4450
## v2.8.0 - 2019-12-07
4551

docs/_sidebar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
- [Examples](examples.md)
66
- [Releasing Task](releasing_task.md)
77
- [Alternative Task Runners](alternative_task_runners.md)
8-
- [![Github](https://icongram.jgog.in/simple/github.svg?color=808080&size=16)Github](https://github.com/go-task/task)
8+
- [![GitHub](https://icongram.jgog.in/simple/github.svg?color=808080&size=16)GitHub](https://github.com/go-task/task)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/stretchr/testify v1.5.1
1111
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
1212
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
13-
mvdan.cc/sh/v3 v3.1.0
13+
mvdan.cc/sh/v3 v3.1.1
1414
)
1515

1616
go 1.13

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,5 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
6262
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
6363
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
6464
mvdan.cc/editorconfig v0.1.1-0.20200121172147-e40951bde157/go.mod h1:Ge4atmRUYqueGppvJ7JNrtqpqokoJEFxYbP0Z+WeKS8=
65-
mvdan.cc/sh/v3 v3.1.0 h1:bFxsEzIubuABloc8G1Ko78rbZZ0JspNN9e9+R/w3z5k=
66-
mvdan.cc/sh/v3 v3.1.0/go.mod h1:F+Vm4ZxPJxDKExMLhvjuI50oPnedVXpfjNSrusiTOno=
65+
mvdan.cc/sh/v3 v3.1.1 h1:niuYC5Ug0KzLuN6CNX3ru37v4MkVD5Wm9T4Mk2eJr9A=
66+
mvdan.cc/sh/v3 v3.1.1/go.mod h1:F+Vm4ZxPJxDKExMLhvjuI50oPnedVXpfjNSrusiTOno=

vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ golang.org/x/xerrors
3939
golang.org/x/xerrors/internal
4040
# gopkg.in/yaml.v2 v2.2.2
4141
gopkg.in/yaml.v2
42-
# mvdan.cc/sh/v3 v3.1.0
42+
# mvdan.cc/sh/v3 v3.1.1
4343
mvdan.cc/sh/v3/expand
4444
mvdan.cc/sh/v3/interp
4545
mvdan.cc/sh/v3/pattern

vendor/mvdan.cc/sh/v3/interp/vars.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ func (o overlayEnviron) Each(f func(name string, vr expand.Variable) bool) {
4141
func execEnv(env expand.Environ) []string {
4242
list := make([]string, 0, 64)
4343
env.Each(func(name string, vr expand.Variable) bool {
44+
if !vr.IsSet() {
45+
// If a variable is set globally but unset in the
46+
// runner, we need to ensure it's not part of the final
47+
// list. Seems like zeroing the element is enough.
48+
// This is a linear search, but this scenario should be
49+
// rare, and the number of variables shouldn't be large.
50+
for i, kv := range list {
51+
if strings.HasPrefix(kv, name+"=") {
52+
list[i] = ""
53+
}
54+
}
55+
}
4456
if vr.Exported {
4557
list = append(list, name+"="+vr.String())
4658
}

vendor/mvdan.cc/sh/v3/syntax/lexer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ func (p *Parser) advanceLitRe(r rune) {
993993
p.quote = noState
994994
return
995995
}
996-
case ' ', '\t', '\r', '\n':
996+
case ' ', '\t', '\r', '\n', ';', '&', '>', '<':
997997
if p.rxOpenParens <= 0 {
998998
p.tok, p.val = _LitWord, p.endLit()
999999
p.quote = noState
@@ -1002,7 +1002,7 @@ func (p *Parser) advanceLitRe(r rune) {
10021002
case '"', '\'', '$', '`':
10031003
p.tok, p.val = _Lit, p.endLit()
10041004
return
1005-
case utf8.RuneSelf, ';', '&', '>', '<':
1005+
case utf8.RuneSelf:
10061006
p.tok, p.val = _LitWord, p.endLit()
10071007
p.quote = noState
10081008
return

vendor/mvdan.cc/sh/v3/syntax/parser.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,12 +545,26 @@ func (p *Parser) doHeredocs() {
545545
if i > 0 && p.r == '\n' {
546546
p.rune()
547547
}
548+
lastLine := p.npos.line
548549
if quoted {
549550
r.Hdoc = p.quotedHdocWord()
550551
} else {
551552
p.next()
552553
r.Hdoc = p.getWord()
553554
}
555+
if r.Hdoc != nil {
556+
lastLine = r.Hdoc.End().line
557+
}
558+
if lastLine < p.npos.line {
559+
// TODO: It seems like this triggers more often than it
560+
// should. Look into it.
561+
l := p.lit(p.npos, "")
562+
if r.Hdoc == nil {
563+
r.Hdoc = p.word(p.wps(l))
564+
} else {
565+
r.Hdoc.Parts = append(r.Hdoc.Parts, l)
566+
}
567+
}
554568
if stop := p.hdocStops[len(p.hdocStops)-1]; stop != nil {
555569
p.posErr(r.Pos(), "unclosed here-document '%s'", stop)
556570
}

vendor/mvdan.cc/sh/v3/syntax/printer.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -165,26 +165,26 @@ type colCounter struct {
165165
lineStart bool
166166
}
167167

168-
func (c *colCounter) WriteByte(b byte) error {
168+
func (c *colCounter) addByte(b byte) {
169169
switch b {
170170
case '\n':
171171
c.column = 0
172172
c.lineStart = true
173-
case '\t', ' ':
173+
case '\t', ' ', tabwriter.Escape:
174174
default:
175175
c.lineStart = false
176176
}
177177
c.column++
178+
}
179+
180+
func (c *colCounter) WriteByte(b byte) error {
181+
c.addByte(b)
178182
return c.Writer.WriteByte(b)
179183
}
180184

181185
func (c *colCounter) WriteString(s string) (int, error) {
182-
c.lineStart = false
183-
for _, r := range s {
184-
if r == '\n' {
185-
c.column = 0
186-
}
187-
c.column++
186+
for _, b := range []byte(s) {
187+
c.addByte(b)
188188
}
189189
return c.Writer.WriteString(s)
190190
}
@@ -269,15 +269,15 @@ func (p *Printer) space() {
269269
}
270270

271271
func (p *Printer) spacePad(pos Pos) {
272-
if p.wantSpace {
273-
p.WriteByte(' ')
274-
p.wantSpace = false
275-
}
276272
if p.cols.lineStart {
277273
// Never add padding at the start of a line, since this may
278274
// result in broken indentation or mixing of spaces and tabs.
279275
return
280276
}
277+
if p.wantSpace {
278+
p.WriteByte(' ')
279+
p.wantSpace = false
280+
}
281281
for !p.cols.lineStart && p.cols.column > 0 && p.cols.column < int(pos.col) {
282282
p.WriteByte(' ')
283283
}
@@ -331,7 +331,7 @@ func (p *Printer) writeLit(s string) {
331331
p.WriteString(s)
332332
return
333333
}
334-
p.WriteByte('\xff')
334+
p.WriteByte(tabwriter.Escape)
335335
for i := 0; i < len(s); i++ {
336336
b := s[i]
337337
if b != '\t' {
@@ -340,7 +340,7 @@ func (p *Printer) writeLit(s string) {
340340
}
341341
p.WriteByte(b)
342342
}
343-
p.WriteByte('\xff')
343+
p.WriteByte(tabwriter.Escape)
344344
}
345345

346346
func (p *Printer) incLevel() {
@@ -370,11 +370,11 @@ func (p *Printer) indent() {
370370
switch {
371371
case p.level == 0:
372372
case p.indentSpaces == 0:
373-
p.WriteByte('\xff')
373+
p.WriteByte(tabwriter.Escape)
374374
for i := uint(0); i < p.level; i++ {
375375
p.WriteByte('\t')
376376
}
377-
p.WriteByte('\xff')
377+
p.WriteByte(tabwriter.Escape)
378378
default:
379379
p.spaces(p.indentSpaces * p.level)
380380
}

0 commit comments

Comments
 (0)