return an error if any of the globs do not match

[finishes #91868284]

Signed-off-by: Toby Rumans <trumans@pivotal.io>
This commit is contained in:
Chris Brown
2015-04-06 11:22:09 -07:00
committed by Toby Rumans
parent 4dbe94c715
commit c9acb4dfc6
2 changed files with 15 additions and 0 deletions

View File

@@ -94,6 +94,10 @@ func (c *OutCommand) Run(sourceDir string, request OutRequest) (OutResponse, err
return OutResponse{}, err
}
if len(matches) == 0 {
return OutResponse{}, fmt.Errorf("could not find file that matches glob '%s'", fileGlob)
}
for _, filePath := range matches {
file, err := os.Open(filePath)
if err != nil {