Merge pull request #103 from brancz/abs-local-source

Use base of absolute path for local dependencies
This commit is contained in:
Frederic Branczyk 2020-05-06 18:32:39 +02:00 committed by GitHub
commit d78a05a86f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -73,7 +73,11 @@ func (s Source) LegacyName() string {
case s.GitSource != nil:
return s.GitSource.LegacyName()
case s.LocalSource != nil:
return filepath.Base(s.LocalSource.Directory)
p, err := filepath.Abs(s.LocalSource.Directory)
if err != nil {
panic("unable to create absolute path from local source directory: " + err.Error())
}
return filepath.Base(p)
default:
return ""
}