Put commit hash and branch name if dependency's version is empty when parsing dep project.

This commit is contained in:
Stanislav Nikitin 2020-02-08 11:54:53 +05:00
parent 5576141721
commit 47ba507e05
No known key found for this signature in database
GPG Key ID: 106900B32F8192EE

View File

@ -88,6 +88,11 @@ func (gp *golangParser) getDependenciesFromDep(pkgPath string) []*structs.Depend
dependency.VCS.Branch = "master"
}
// If version is empty - write branch name here with commit hash.
if dependency.Version == "" {
dependency.Version = dependency.VCS.Revision + "@" + dependency.VCS.Branch
}
// All dep-controlled dependencies are vendored. We should get
// it's path.
dependency.LocalPath = filepath.Join(pkgPath, "vendor", dep.Name)