From f0fdf865a19790530853e9b15ef6b149e37ebc81 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Tue, 18 Aug 2015 10:53:33 +0000 Subject: [PATCH] allow wildcards in artifice files Signed-off-by: Vasiliy Tolstov --- post-processor/artifice/artifact.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/post-processor/artifice/artifact.go b/post-processor/artifice/artifact.go index cb344b8e2..de55e46e6 100644 --- a/post-processor/artifice/artifact.go +++ b/post-processor/artifice/artifact.go @@ -3,6 +3,7 @@ package artifice import ( "fmt" "os" + "path/filepath" "strings" ) @@ -13,13 +14,18 @@ type Artifact struct { } func NewArtifact(files []string) (*Artifact, error) { + artifact := &Artifact{} for _, f := range files { - if _, err := os.Stat(f); err != nil { + globfiles, err := filepath.Glob(f) + if err != nil { return nil, err } - } - artifact := &Artifact{ - files: files, + for _, gf := range globfiles { + if _, err := os.Stat(gf); err != nil { + return nil, err + } + artifact.files = append(artifact.files, gf) + } } return artifact, nil }