mirror of
https://github.com/TECHNOFAB11/jsonnet-bundler.git
synced 2026-02-02 09:25:08 +01:00
For local dependencies check if abs path exists
This commit is contained in:
parent
e655fcaf60
commit
6ed6c3f3ec
4 changed files with 11 additions and 8 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue