mirror of
https://github.com/go-task/task.git
synced 2025-03-17 21:08:01 +02:00
parent
ba494702ed
commit
e97fd65cd3
105
Gopkg.lock
generated
Normal file
105
Gopkg.lock
generated
Normal file
@ -0,0 +1,105 @@
|
||||
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
|
||||
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/BurntSushi/toml"
|
||||
packages = ["."]
|
||||
revision = "b26d9c308763d68093482582cea63d69be07a0f0"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/Masterminds/semver"
|
||||
packages = ["."]
|
||||
revision = "abff1900528dbdaf6f3f5aa92c398be1eaf2a9f7"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/Masterminds/sprig"
|
||||
packages = ["."]
|
||||
revision = "e039e20e500c2c025d9145be375e27cf42a94174"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/aokoli/goutils"
|
||||
packages = ["."]
|
||||
revision = "3391d3790d23d03408670993e957e8f408993c34"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/fsnotify/fsnotify"
|
||||
packages = ["."]
|
||||
revision = "4da3e2cfbabc9f751898f250b49f2439785783a1"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/huandu/xstrings"
|
||||
packages = ["."]
|
||||
revision = "3959339b333561bf62a38b424fd41517c2c90f40"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/imdario/mergo"
|
||||
packages = ["."]
|
||||
revision = "d806ba8c21777d504a2090a2ca4913c750dd3a33"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/mattn/go-zglob"
|
||||
packages = [".","fastwalk"]
|
||||
revision = "95345c4e1c0ebc9d16a3284177f09360f4d20fab"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/mvdan/sh"
|
||||
packages = ["interp","syntax"]
|
||||
revision = "c79708369f1c3cde582a511d52173966c25edefd"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/satori/go.uuid"
|
||||
packages = ["."]
|
||||
revision = "5bf94b69c6b68ee1b541973bb8e1144db23a194b"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/spf13/pflag"
|
||||
packages = ["."]
|
||||
revision = "e57e3eeb33f795204c1ca35f56c44f83227c6e66"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "golang.org/x/crypto"
|
||||
packages = ["pbkdf2","scrypt"]
|
||||
revision = "e1a4589e7d3ea14a3352255d04b6f1a418845e5e"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "golang.org/x/net"
|
||||
packages = ["context"]
|
||||
revision = "e4fa1c5465ad6111f206fc92186b8c83d64adbe1"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "golang.org/x/sync"
|
||||
packages = ["errgroup"]
|
||||
revision = "f52d1811a62927559de87708c8913c1650ce4f26"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "golang.org/x/sys"
|
||||
packages = ["unix"]
|
||||
revision = "b90f89a1e7a9c1f6b918820b3daa7f08488c8594"
|
||||
|
||||
[[projects]]
|
||||
branch = "v2"
|
||||
name = "gopkg.in/yaml.v2"
|
||||
packages = ["."]
|
||||
revision = "cd8b52f8269e0feb286dfeef29f8fe4d5b397e0b"
|
||||
|
||||
[solve-meta]
|
||||
analyzer-name = "dep"
|
||||
analyzer-version = 1
|
||||
inputs-digest = "2f626389e1dc4d5ac2e6b83c6b9a50cab0dd3187bbc4e03694810df03a08b3fc"
|
||||
solver-name = "gps-cdcl"
|
||||
solver-version = 1
|
103
Gopkg.toml
Normal file
103
Gopkg.toml
Normal file
@ -0,0 +1,103 @@
|
||||
|
||||
## Gopkg.toml example (these lines may be deleted)
|
||||
|
||||
## "metadata" defines metadata about the project that could be used by other independent
|
||||
## systems. The metadata defined here will be ignored by dep.
|
||||
# [metadata]
|
||||
# key1 = "value that convey data to other systems"
|
||||
# system1-data = "value that is used by a system"
|
||||
# system2-data = "value that is used by another system"
|
||||
|
||||
## "required" lists a set of packages (not projects) that must be included in
|
||||
## Gopkg.lock. This list is merged with the set of packages imported by the current
|
||||
## project. Use it when your project needs a package it doesn't explicitly import -
|
||||
## including "main" packages.
|
||||
# required = ["github.com/user/thing/cmd/thing"]
|
||||
|
||||
## "ignored" lists a set of packages (not projects) that are ignored when
|
||||
## dep statically analyzes source code. Ignored packages can be in this project,
|
||||
## or in a dependency.
|
||||
# ignored = ["github.com/user/project/badpkg"]
|
||||
|
||||
## Constraints are rules for how directly imported projects
|
||||
## may be incorporated into the depgraph. They are respected by
|
||||
## dep whether coming from the Gopkg.toml of the current project or a dependency.
|
||||
# [[constraint]]
|
||||
## Required: the root import path of the project being constrained.
|
||||
# name = "github.com/user/project"
|
||||
#
|
||||
## Recommended: the version constraint to enforce for the project.
|
||||
## Only one of "branch", "version" or "revision" can be specified.
|
||||
# version = "1.0.0"
|
||||
# branch = "master"
|
||||
# revision = "abc123"
|
||||
#
|
||||
## Optional: an alternate location (URL or import path) for the project's source.
|
||||
# source = "https://github.com/myfork/package.git"
|
||||
#
|
||||
## "metadata" defines metadata about the dependency or override that could be used
|
||||
## by other independent systems. The metadata defined here will be ignored by dep.
|
||||
# [metadata]
|
||||
# key1 = "value that convey data to other systems"
|
||||
# system1-data = "value that is used by a system"
|
||||
# system2-data = "value that is used by another system"
|
||||
|
||||
## Overrides have the same structure as [[constraint]], but supersede all
|
||||
## [[constraint]] declarations from all projects. Only [[override]] from
|
||||
## the current project's are applied.
|
||||
##
|
||||
## Overrides are a sledgehammer. Use them only as a last resort.
|
||||
# [[override]]
|
||||
## Required: the root import path of the project being constrained.
|
||||
# name = "github.com/user/project"
|
||||
#
|
||||
## Optional: specifying a version constraint override will cause all other
|
||||
## constraints on this project to be ignored; only the overridden constraint
|
||||
## need be satisfied.
|
||||
## Again, only one of "branch", "version" or "revision" can be specified.
|
||||
# version = "1.0.0"
|
||||
# branch = "master"
|
||||
# revision = "abc123"
|
||||
#
|
||||
## Optional: specifying an alternate source location as an override will
|
||||
## enforce that the alternate location is used for that project, regardless of
|
||||
## what source location any dependent projects specify.
|
||||
# source = "https://github.com/myfork/package.git"
|
||||
|
||||
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "github.com/BurntSushi/toml"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "github.com/Masterminds/sprig"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "github.com/fsnotify/fsnotify"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "github.com/imdario/mergo"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "github.com/mattn/go-zglob"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "github.com/mvdan/sh"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "github.com/spf13/pflag"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "golang.org/x/sync"
|
||||
|
||||
[[constraint]]
|
||||
branch = "v2"
|
||||
name = "gopkg.in/yaml.v2"
|
106
vendor/github.com/mvdan/sh/interp/interp.go
generated
vendored
106
vendor/github.com/mvdan/sh/interp/interp.go
generated
vendored
@ -12,6 +12,7 @@ import (
|
||||
"os/exec"
|
||||
"os/user"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
@ -97,7 +98,6 @@ func (r *Runner) varInd(v varValue, e syntax.ArithmExpr) string {
|
||||
return x
|
||||
}
|
||||
case []string:
|
||||
// TODO: @ between double quotes
|
||||
if w, ok := e.(*syntax.Word); ok {
|
||||
if lit, ok := w.Parts[0].(*syntax.Lit); ok {
|
||||
switch lit.Value {
|
||||
@ -224,10 +224,43 @@ func (r *Runner) errf(format string, a ...interface{}) {
|
||||
fmt.Fprintf(r.Stderr, format, a...)
|
||||
}
|
||||
|
||||
func fieldJoin(parts []fieldPart) string {
|
||||
var buf bytes.Buffer
|
||||
for _, part := range parts {
|
||||
buf.WriteString(part.val)
|
||||
}
|
||||
return buf.String()
|
||||
}
|
||||
|
||||
func escapeQuotedParts(parts []fieldPart) string {
|
||||
var buf bytes.Buffer
|
||||
for _, part := range parts {
|
||||
if !part.quoted {
|
||||
buf.WriteString(part.val)
|
||||
continue
|
||||
}
|
||||
for _, r := range part.val {
|
||||
switch r {
|
||||
case '*', '?', '\\', '[':
|
||||
buf.WriteByte('\\')
|
||||
}
|
||||
buf.WriteRune(r)
|
||||
}
|
||||
}
|
||||
return buf.String()
|
||||
}
|
||||
|
||||
func (r *Runner) fields(words []*syntax.Word) []string {
|
||||
fields := make([]string, 0, len(words))
|
||||
for _, word := range words {
|
||||
fields = append(fields, r.wordParts(word.Parts, false)...)
|
||||
for _, field := range r.wordFields(word.Parts, false) {
|
||||
matches, _ := filepath.Glob(escapeQuotedParts(field))
|
||||
if len(matches) > 0 {
|
||||
fields = append(fields, matches...)
|
||||
} else {
|
||||
fields = append(fields, fieldJoin(field))
|
||||
}
|
||||
}
|
||||
}
|
||||
return fields
|
||||
}
|
||||
@ -236,7 +269,13 @@ func (r *Runner) loneWord(word *syntax.Word) string {
|
||||
if word == nil {
|
||||
return ""
|
||||
}
|
||||
return strings.Join(r.wordParts(word.Parts, false), "")
|
||||
var buf bytes.Buffer
|
||||
for _, field := range r.wordFields(word.Parts, false) {
|
||||
for _, part := range field {
|
||||
buf.WriteString(part.val)
|
||||
}
|
||||
}
|
||||
return buf.String()
|
||||
}
|
||||
|
||||
func (r *Runner) stop() bool {
|
||||
@ -453,8 +492,11 @@ func (r *Runner) cmd(cm syntax.Command) {
|
||||
str := r.loneWord(x.Word)
|
||||
for _, ci := range x.Items {
|
||||
for _, word := range ci.Patterns {
|
||||
pat := r.loneWord(word)
|
||||
if match(pat, str) {
|
||||
var buf bytes.Buffer
|
||||
for _, field := range r.wordFields(word.Parts, false) {
|
||||
buf.WriteString(escapeQuotedParts(field))
|
||||
}
|
||||
if match(buf.String(), str) {
|
||||
r.stmts(ci.Stmts)
|
||||
return
|
||||
}
|
||||
@ -560,16 +602,21 @@ func (r *Runner) loopStmtsBroken(stmts []*syntax.Stmt) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (r *Runner) wordParts(wps []syntax.WordPart, quoted bool) []string {
|
||||
var parts []string
|
||||
var curBuf bytes.Buffer
|
||||
type fieldPart struct {
|
||||
val string
|
||||
quoted bool
|
||||
}
|
||||
|
||||
func (r *Runner) wordFields(wps []syntax.WordPart, quoted bool) [][]fieldPart {
|
||||
var fields [][]fieldPart
|
||||
var curField []fieldPart
|
||||
allowEmpty := false
|
||||
flush := func() {
|
||||
if curBuf.Len() == 0 {
|
||||
if len(curField) == 0 {
|
||||
return
|
||||
}
|
||||
parts = append(parts, curBuf.String())
|
||||
curBuf.Reset()
|
||||
fields = append(fields, curField)
|
||||
curField = nil
|
||||
}
|
||||
splitAdd := func(val string) {
|
||||
// TODO: use IFS
|
||||
@ -577,7 +624,7 @@ func (r *Runner) wordParts(wps []syntax.WordPart, quoted bool) []string {
|
||||
if i > 0 {
|
||||
flush()
|
||||
}
|
||||
curBuf.WriteString(field)
|
||||
curField = append(curField, fieldPart{val: field})
|
||||
}
|
||||
}
|
||||
for i, wp := range wps {
|
||||
@ -589,10 +636,13 @@ func (r *Runner) wordParts(wps []syntax.WordPart, quoted bool) []string {
|
||||
// TODO: ~someuser
|
||||
s = r.getVar("HOME") + s[1:]
|
||||
}
|
||||
curBuf.WriteString(s)
|
||||
curField = append(curField, fieldPart{val: s})
|
||||
case *syntax.SglQuoted:
|
||||
allowEmpty = true
|
||||
curBuf.WriteString(x.Value)
|
||||
curField = append(curField, fieldPart{
|
||||
quoted: true,
|
||||
val: x.Value,
|
||||
})
|
||||
case *syntax.DblQuoted:
|
||||
allowEmpty = true
|
||||
if len(x.Parts) == 1 {
|
||||
@ -602,18 +652,26 @@ func (r *Runner) wordParts(wps []syntax.WordPart, quoted bool) []string {
|
||||
if i > 0 {
|
||||
flush()
|
||||
}
|
||||
curBuf.WriteString(elem)
|
||||
curField = append(curField, fieldPart{
|
||||
quoted: true,
|
||||
val: elem,
|
||||
})
|
||||
}
|
||||
continue
|
||||
}
|
||||
}
|
||||
for _, str := range r.wordParts(x.Parts, true) {
|
||||
curBuf.WriteString(str)
|
||||
for _, field := range r.wordFields(x.Parts, true) {
|
||||
for _, part := range field {
|
||||
curField = append(curField, fieldPart{
|
||||
quoted: true,
|
||||
val: part.val,
|
||||
})
|
||||
}
|
||||
}
|
||||
case *syntax.ParamExp:
|
||||
val := r.paramExp(x)
|
||||
if quoted {
|
||||
curBuf.WriteString(val)
|
||||
curField = append(curField, fieldPart{val: val})
|
||||
} else {
|
||||
splitAdd(val)
|
||||
}
|
||||
@ -624,21 +682,23 @@ func (r *Runner) wordParts(wps []syntax.WordPart, quoted bool) []string {
|
||||
r2.stmts(x.Stmts)
|
||||
val := strings.TrimRight(buf.String(), "\n")
|
||||
if quoted {
|
||||
curBuf.WriteString(val)
|
||||
curField = append(curField, fieldPart{val: val})
|
||||
} else {
|
||||
splitAdd(val)
|
||||
}
|
||||
case *syntax.ArithmExp:
|
||||
curBuf.WriteString(strconv.Itoa(r.arithm(x.X)))
|
||||
curField = append(curField, fieldPart{
|
||||
val: strconv.Itoa(r.arithm(x.X)),
|
||||
})
|
||||
default:
|
||||
r.runErr(wp.Pos(), "unhandled word part: %T", x)
|
||||
}
|
||||
}
|
||||
flush()
|
||||
if allowEmpty && len(parts) == 0 {
|
||||
parts = append(parts, "")
|
||||
if allowEmpty && len(fields) == 0 {
|
||||
fields = append(fields, []fieldPart{{}})
|
||||
}
|
||||
return parts
|
||||
return fields
|
||||
}
|
||||
|
||||
func (r *Runner) call(pos syntax.Pos, name string, args []string) {
|
||||
|
18
vendor/github.com/mvdan/sh/interp/test.go
generated
vendored
18
vendor/github.com/mvdan/sh/interp/test.go
generated
vendored
@ -4,6 +4,7 @@
|
||||
package interp
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
@ -20,6 +21,19 @@ func (r *Runner) bashTest(expr syntax.TestExpr) string {
|
||||
case *syntax.ParenTest:
|
||||
return r.bashTest(x.X)
|
||||
case *syntax.BinaryTest:
|
||||
switch x.Op {
|
||||
case syntax.TsMatch, syntax.TsNoMatch:
|
||||
str := r.loneWord(x.X.(*syntax.Word))
|
||||
var buf bytes.Buffer
|
||||
yw := x.Y.(*syntax.Word)
|
||||
for _, field := range r.wordFields(yw.Parts, false) {
|
||||
buf.WriteString(escapeQuotedParts(field))
|
||||
}
|
||||
if match(buf.String(), str) == (x.Op == syntax.TsMatch) {
|
||||
return "1"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
if r.binTest(x.Op, r.bashTest(x.X), r.bashTest(x.Y)) {
|
||||
return "1"
|
||||
}
|
||||
@ -73,10 +87,6 @@ func (r *Runner) binTest(op syntax.BinTestOperator, x, y string) bool {
|
||||
return x != "" && y != ""
|
||||
case syntax.OrTest:
|
||||
return x != "" || y != ""
|
||||
case syntax.TsMatch:
|
||||
return match(y, x)
|
||||
case syntax.TsNoMatch:
|
||||
return !match(y, x)
|
||||
case syntax.TsBefore:
|
||||
return x < y
|
||||
default: // syntax.TsAfter
|
||||
|
20
vendor/github.com/mvdan/sh/syntax/nodes.go
generated
vendored
20
vendor/github.com/mvdan/sh/syntax/nodes.go
generated
vendored
@ -172,12 +172,16 @@ func (*TimeClause) commandNode() {}
|
||||
func (*CoprocClause) commandNode() {}
|
||||
|
||||
// Assign represents an assignment to a variable.
|
||||
//
|
||||
// Here and elsewhere, Index can either mean an index into an indexed or
|
||||
// an associative array. In the former, it's just an arithmetic
|
||||
// expression. In the latter, it will be a word with a single DblQuoted
|
||||
// part.
|
||||
type Assign struct {
|
||||
Append bool // +=
|
||||
Naked bool // without '='
|
||||
Name *Lit
|
||||
Index ArithmExpr // [i]
|
||||
Key *DblQuoted // ["k"]
|
||||
Index ArithmExpr // [i], ["k"]
|
||||
Value *Word // =val
|
||||
Array *ArrayExpr // =(arr)
|
||||
}
|
||||
@ -192,8 +196,6 @@ func (a *Assign) End() Pos {
|
||||
}
|
||||
if a.Index != nil {
|
||||
return a.Index.End() + 2
|
||||
} else if a.Key != nil {
|
||||
return a.Key.End() + 2
|
||||
}
|
||||
if a.Naked {
|
||||
return a.Name.End()
|
||||
@ -429,8 +431,7 @@ type ParamExp struct {
|
||||
Length bool // ${#a}
|
||||
Width bool // ${%a}
|
||||
Param *Lit
|
||||
Index ArithmExpr // ${a[i]}
|
||||
Key *DblQuoted // ${a["k"]}
|
||||
Index ArithmExpr // ${a[i]}, ${a["k"]}
|
||||
Slice *Slice // ${a:x:y}
|
||||
Repl *Replace // ${a/x/y}
|
||||
Exp *Expansion // ${a:-b}, ${a#b}, etc
|
||||
@ -443,14 +444,12 @@ func (p *ParamExp) End() Pos {
|
||||
}
|
||||
if p.Index != nil {
|
||||
return p.Index.End() + 1
|
||||
} else if p.Key != nil {
|
||||
return p.Key.End() + 1
|
||||
}
|
||||
return p.Param.End()
|
||||
}
|
||||
|
||||
func (p *ParamExp) nakedIndex() bool {
|
||||
return p.Short && (p.Index != nil || p.Key != nil)
|
||||
return p.Short && p.Index != nil
|
||||
}
|
||||
|
||||
// Slice represents character slicing inside a ParamExp.
|
||||
@ -673,15 +672,12 @@ func (a *ArrayExpr) End() Pos { return a.Rparen + 1 }
|
||||
|
||||
type ArrayElem struct {
|
||||
Index ArithmExpr
|
||||
Key *DblQuoted
|
||||
Value *Word
|
||||
}
|
||||
|
||||
func (a *ArrayElem) Pos() Pos {
|
||||
if a.Index != nil {
|
||||
return a.Index.Pos()
|
||||
} else if a.Key != nil {
|
||||
return a.Key.Pos()
|
||||
}
|
||||
return a.Value.Pos()
|
||||
}
|
||||
|
8
vendor/github.com/mvdan/sh/syntax/parser.go
generated
vendored
8
vendor/github.com/mvdan/sh/syntax/parser.go
generated
vendored
@ -901,7 +901,7 @@ func (p *Parser) arithmExprBase(compact bool) ArithmExpr {
|
||||
old := p.preNested(arithmExprBrack)
|
||||
p.next()
|
||||
if p.tok == dblQuote {
|
||||
pe.Key = p.dblQuoted()
|
||||
pe.Index = p.word(p.wps(p.dblQuoted()))
|
||||
} else {
|
||||
pe.Index = p.followArithm(leftBrack, left)
|
||||
}
|
||||
@ -1028,7 +1028,7 @@ func (p *Parser) paramExp() *ParamExp {
|
||||
p.tok, p.val = _LitWord, p.tok.String()
|
||||
}
|
||||
if p.tok == dblQuote {
|
||||
pe.Key = p.dblQuoted()
|
||||
pe.Index = p.word(p.wps(p.dblQuoted()))
|
||||
} else {
|
||||
pe.Index = p.followArithm(leftBrack, lpos)
|
||||
}
|
||||
@ -1170,7 +1170,7 @@ func (p *Parser) getAssign(needEqual bool) *Assign {
|
||||
p.tok, p.val = _LitWord, p.tok.String()
|
||||
}
|
||||
if p.tok == dblQuote {
|
||||
as.Key = p.dblQuoted()
|
||||
as.Index = p.word(p.wps(p.dblQuoted()))
|
||||
} else {
|
||||
as.Index = p.followArithm(leftBrack, left)
|
||||
}
|
||||
@ -1219,7 +1219,7 @@ func (p *Parser) getAssign(needEqual bool) *Assign {
|
||||
p.quote = arithmExprBrack
|
||||
p.next()
|
||||
if p.tok == dblQuote {
|
||||
ae.Key = p.dblQuoted()
|
||||
ae.Index = p.word(p.wps(p.dblQuoted()))
|
||||
} else {
|
||||
ae.Index = p.followArithm(leftBrack, left)
|
||||
}
|
||||
|
18
vendor/github.com/mvdan/sh/syntax/printer.go
generated
vendored
18
vendor/github.com/mvdan/sh/syntax/printer.go
generated
vendored
@ -345,16 +345,12 @@ func (p *Printer) dblQuoted(dq *DblQuoted) {
|
||||
p.WriteByte('"')
|
||||
}
|
||||
|
||||
func (p *Printer) wroteIndex(index ArithmExpr, key *DblQuoted) bool {
|
||||
if index == nil && key == nil {
|
||||
func (p *Printer) wroteIndex(index ArithmExpr) bool {
|
||||
if index == nil {
|
||||
return false
|
||||
}
|
||||
p.WriteByte('[')
|
||||
if index != nil {
|
||||
p.arithmExpr(index, false, false)
|
||||
} else {
|
||||
p.dblQuoted(key)
|
||||
}
|
||||
p.arithmExpr(index, false, false)
|
||||
p.WriteByte(']')
|
||||
return true
|
||||
}
|
||||
@ -362,7 +358,7 @@ func (p *Printer) wroteIndex(index ArithmExpr, key *DblQuoted) bool {
|
||||
func (p *Printer) paramExp(pe *ParamExp) {
|
||||
if pe.nakedIndex() { // arr[x]
|
||||
p.WriteString(pe.Param.Value)
|
||||
p.wroteIndex(pe.Index, pe.Key)
|
||||
p.wroteIndex(pe.Index)
|
||||
return
|
||||
}
|
||||
if pe.Short { // $var
|
||||
@ -381,7 +377,7 @@ func (p *Printer) paramExp(pe *ParamExp) {
|
||||
p.WriteByte('!')
|
||||
}
|
||||
p.WriteString(pe.Param.Value)
|
||||
p.wroteIndex(pe.Index, pe.Key)
|
||||
p.wroteIndex(pe.Index)
|
||||
if pe.Slice != nil {
|
||||
p.WriteByte(':')
|
||||
p.arithmExpr(pe.Slice.Offset, true, true)
|
||||
@ -560,7 +556,7 @@ func (p *Printer) elemJoin(elems []*ArrayElem) {
|
||||
p.WriteByte(' ')
|
||||
p.wantSpace = false
|
||||
}
|
||||
if p.wroteIndex(el.Index, el.Key) {
|
||||
if p.wroteIndex(el.Index) {
|
||||
p.WriteByte('=')
|
||||
}
|
||||
p.word(el.Value)
|
||||
@ -981,7 +977,7 @@ func (p *Printer) assigns(assigns []*Assign, alwaysEqual bool) {
|
||||
}
|
||||
if a.Name != nil {
|
||||
p.WriteString(a.Name.Value)
|
||||
p.wroteIndex(a.Index, a.Key)
|
||||
p.wroteIndex(a.Index)
|
||||
if a.Append {
|
||||
p.WriteByte('+')
|
||||
}
|
||||
|
4
vendor/github.com/mvdan/sh/syntax/simplify.go
generated
vendored
4
vendor/github.com/mvdan/sh/syntax/simplify.go
generated
vendored
@ -149,8 +149,8 @@ func (s *simplifier) inlineSimpleParams(x ArithmExpr) ArithmExpr {
|
||||
if pe == nil || !ValidName(pe.Param.Value) {
|
||||
return x
|
||||
}
|
||||
if pe.Indirect || pe.Length || pe.Width || pe.Key != nil ||
|
||||
pe.Slice != nil || pe.Repl != nil || pe.Exp != nil {
|
||||
if pe.Indirect || pe.Length || pe.Width || pe.Slice != nil ||
|
||||
pe.Repl != nil || pe.Exp != nil {
|
||||
return x
|
||||
}
|
||||
if pe.Index != nil {
|
||||
|
6
vendor/github.com/mvdan/sh/syntax/walk.go
generated
vendored
6
vendor/github.com/mvdan/sh/syntax/walk.go
generated
vendored
@ -48,8 +48,6 @@ func Walk(node Node, f func(Node) bool) {
|
||||
}
|
||||
if x.Index != nil {
|
||||
Walk(x.Index, f)
|
||||
} else if x.Key != nil {
|
||||
Walk(x.Key, f)
|
||||
}
|
||||
if x.Array != nil {
|
||||
Walk(x.Array, f)
|
||||
@ -117,8 +115,6 @@ func Walk(node Node, f func(Node) bool) {
|
||||
Walk(x.Param, f)
|
||||
if x.Index != nil {
|
||||
Walk(x.Index, f)
|
||||
} else if x.Key != nil {
|
||||
Walk(x.Key, f)
|
||||
}
|
||||
if x.Repl != nil {
|
||||
if x.Repl.Orig != nil {
|
||||
@ -169,8 +165,6 @@ func Walk(node Node, f func(Node) bool) {
|
||||
case *ArrayElem:
|
||||
if x.Index != nil {
|
||||
Walk(x.Index, f)
|
||||
} else if x.Key != nil {
|
||||
Walk(x.Key, f)
|
||||
}
|
||||
Walk(x.Value, f)
|
||||
case *ExtGlob:
|
||||
|
121
vendor/vendor.json
vendored
121
vendor/vendor.json
vendored
@ -1,121 +0,0 @@
|
||||
{
|
||||
"comment": "",
|
||||
"ignore": "test",
|
||||
"package": [
|
||||
{
|
||||
"checksumSHA1": "pPH/BoINXxzYDObljpsGZbysMrw=",
|
||||
"path": "github.com/BurntSushi/toml",
|
||||
"revision": "b26d9c308763d68093482582cea63d69be07a0f0",
|
||||
"revisionTime": "2017-03-28T06:15:53Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "7Ncpz6uCsQgFIrDCADflnyXqmYI=",
|
||||
"path": "github.com/Masterminds/semver",
|
||||
"revision": "abff1900528dbdaf6f3f5aa92c398be1eaf2a9f7",
|
||||
"revisionTime": "2017-05-02T10:47:25Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "fdKCyDbBjbSYmsVNhGT7XBD3Wkg=",
|
||||
"path": "github.com/Masterminds/sprig",
|
||||
"revision": "e039e20e500c2c025d9145be375e27cf42a94174",
|
||||
"revisionTime": "2017-05-26T13:44:39Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "X0xGt0e0IkZeviF+pFRlpHP+xkE=",
|
||||
"path": "github.com/aokoli/goutils",
|
||||
"revision": "3391d3790d23d03408670993e957e8f408993c34",
|
||||
"revisionTime": "2017-05-31T11:00:25Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "x2Km0Qy3WgJJnV19Zv25VwTJcBM=",
|
||||
"path": "github.com/fsnotify/fsnotify",
|
||||
"revision": "4da3e2cfbabc9f751898f250b49f2439785783a1",
|
||||
"revisionTime": "2017-03-29T04:21:07Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "0MZ+LgAY36oK73IE9297Vf4NTXU=",
|
||||
"path": "github.com/huandu/xstrings",
|
||||
"revision": "3959339b333561bf62a38b424fd41517c2c90f40",
|
||||
"revisionTime": "2015-11-30T12:51:19Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "VBXGouqOkPe3OkeJnyUBkx3aZXA=",
|
||||
"path": "github.com/imdario/mergo",
|
||||
"revision": "d806ba8c21777d504a2090a2ca4913c750dd3a33",
|
||||
"revisionTime": "2017-03-26T20:45:27Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "5xzgVm4v/J7VXwtip+KDu96be18=",
|
||||
"path": "github.com/mattn/go-zglob",
|
||||
"revision": "95345c4e1c0ebc9d16a3284177f09360f4d20fab",
|
||||
"revisionTime": "2017-01-24T11:57:57Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "xcAVbwtk3z9gi2Eig6DYgAiMzSc=",
|
||||
"path": "github.com/mattn/go-zglob/fastwalk",
|
||||
"revision": "95345c4e1c0ebc9d16a3284177f09360f4d20fab",
|
||||
"revisionTime": "2017-01-24T11:57:57Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "Ok+QCNYz0pqi7EZ8X29+vvUEsDg=",
|
||||
"path": "github.com/mvdan/sh/interp",
|
||||
"revision": "01ad46f165fea854f10fae6459165a9a7138c6f2",
|
||||
"revisionTime": "2017-05-31T17:48:32Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "KmlsN0IQuUhR9/eSC8THX28AaBM=",
|
||||
"path": "github.com/mvdan/sh/syntax",
|
||||
"revision": "01ad46f165fea854f10fae6459165a9a7138c6f2",
|
||||
"revisionTime": "2017-05-31T17:48:32Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "zmC8/3V4ls53DJlNTKDZwPSC/dA=",
|
||||
"path": "github.com/satori/go.uuid",
|
||||
"revision": "5bf94b69c6b68ee1b541973bb8e1144db23a194b",
|
||||
"revisionTime": "2017-03-21T23:07:31Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "STxYqRb4gnlSr3mRpT+Igfdz/kM=",
|
||||
"path": "github.com/spf13/pflag",
|
||||
"revision": "e57e3eeb33f795204c1ca35f56c44f83227c6e66",
|
||||
"revisionTime": "2017-05-08T18:43:26Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "1MGpGDQqnUoRpv7VEcQrXOBydXE=",
|
||||
"path": "golang.org/x/crypto/pbkdf2",
|
||||
"revision": "e1a4589e7d3ea14a3352255d04b6f1a418845e5e",
|
||||
"revisionTime": "2017-05-23T23:42:09Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "E8pDMGySfy5Mw+jzXOkOxo35bww=",
|
||||
"path": "golang.org/x/crypto/scrypt",
|
||||
"revision": "e1a4589e7d3ea14a3352255d04b6f1a418845e5e",
|
||||
"revisionTime": "2017-05-23T23:42:09Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "Y+HGqEkYM15ir+J93MEaHdyFy0c=",
|
||||
"path": "golang.org/x/net/context",
|
||||
"revision": "e4fa1c5465ad6111f206fc92186b8c83d64adbe1",
|
||||
"revisionTime": "2017-06-02T19:04:32Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "S0DP7Pn7sZUmXc55IzZnNvERu6s=",
|
||||
"path": "golang.org/x/sync/errgroup",
|
||||
"revision": "f52d1811a62927559de87708c8913c1650ce4f26",
|
||||
"revisionTime": "2017-05-17T20:25:26Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "PugQbLLjnbBSj+NOXRYBVRnLuuQ=",
|
||||
"path": "golang.org/x/sys/unix",
|
||||
"revision": "b90f89a1e7a9c1f6b918820b3daa7f08488c8594",
|
||||
"revisionTime": "2017-05-29T13:44:53Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "fALlQNY1fM99NesfLJ50KguWsio=",
|
||||
"path": "gopkg.in/yaml.v2",
|
||||
"revision": "cd8b52f8269e0feb286dfeef29f8fe4d5b397e0b",
|
||||
"revisionTime": "2017-04-07T17:21:22Z"
|
||||
}
|
||||
],
|
||||
"rootPath": "github.com/go-task/task"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user