For local dependencies check if abs path exists

This commit is contained in:
Matthias Loibl 2019-08-12 11:50:56 +02:00
parent e655fcaf60
commit 6ed6c3f3ec
No known key found for this signature in database
GPG key ID: 78A796CA74CA38BA
4 changed files with 11 additions and 8 deletions

View file

@ -93,7 +93,7 @@ func Main() int {
return 0
}
func parseDependency(path string) *spec.Dependency {
func parseDependency(dir, path string) *spec.Dependency {
if d := parseGitSSHDependency(path); d != nil {
return d
}
@ -102,7 +102,7 @@ func parseDependency(path string) *spec.Dependency {
return d
}
if d := parseLocalDependency(path); d != nil {
if d := parseLocalDependency(dir, path); d != nil {
return d
}
@ -211,7 +211,7 @@ func parseGithubDependency(p string) *spec.Dependency {
}
}
func parseLocalDependency(p string) *spec.Dependency {
func parseLocalDependency(dir, p string) *spec.Dependency {
if p == "" {
return nil
}
@ -223,8 +223,9 @@ func parseLocalDependency(p string) *spec.Dependency {
}
clean := filepath.Clean(p)
abs := filepath.Join(dir, clean)
info, err := os.Stat(clean)
info, err := os.Stat(abs)
if err != nil {
return nil
}