Fix path deletion on artifacts

This commit is contained in:
Ettore Di Giacinto
2019-11-29 19:01:59 +01:00
parent 848b270e81
commit c7e1803540
2 changed files with 6 additions and 5 deletions

View File

@@ -36,10 +36,10 @@ import (
type ArtifactIndex []Artifact
func (i ArtifactIndex) CleanPath() ArtifactIndex {
var newIndex []Artifact
copy(newIndex, i)
for _, n := range newIndex {
n.SetPath(path.Base(n.GetPath()))
newIndex := ArtifactIndex{}
for _, n := range i {
art := n.(*PackageArtifact)
newIndex = append(newIndex, &PackageArtifact{Path: path.Base(n.GetPath()), SourceAssertion: art.SourceAssertion, CompileSpec: art.CompileSpec, Dependencies: art.Dependencies})
}
return newIndex
//Update if exists, otherwise just create