Fix spec archives one zip file twice (#1068)

This commit is contained in:
Vishal
2019-01-22 00:07:57 +08:00
committed by Ta-Ching Chen
parent 2efa255eb4
commit 68a511184f
+2 -1
View File
@@ -975,7 +975,7 @@ func localArchiveFromSpec(specDir string, aus *ArchiveUploadSpec) (*fission.Arch
files := make([]string, 0) files := make([]string, 0)
if len(aus.IncludeGlobs) == 1 && archiver.Zip.Match(aus.IncludeGlobs[0]) { if len(aus.IncludeGlobs) == 1 && archiver.Zip.Match(aus.IncludeGlobs[0]) {
files = append(files, aus.IncludeGlobs[0]) files = append(files, aus.IncludeGlobs[0])
} } else {
for _, relativeGlob := range aus.IncludeGlobs { for _, relativeGlob := range aus.IncludeGlobs {
absGlob := rootDir + "/" + relativeGlob absGlob := rootDir + "/" + relativeGlob
f, err := filepath.Glob(absGlob) f, err := filepath.Glob(absGlob)
@@ -986,6 +986,7 @@ func localArchiveFromSpec(specDir string, aus *ArchiveUploadSpec) (*fission.Arch
files = append(files, f...) files = append(files, f...)
// xxx handle excludeGlobs here // xxx handle excludeGlobs here
} }
}
if len(files) == 0 { if len(files) == 0 {
return nil, fmt.Errorf("Archive '%v' is empty", aus.Name) return nil, fmt.Errorf("Archive '%v' is empty", aus.Name)