mirror of
https://github.com/TECHNOFAB11/jsonnet-bundler.git
synced 2025-12-13 08:30:04 +01:00
Fix no dependency inserted when previous array is empty
This commit is contained in:
parent
f69df626e3
commit
51388f041b
1 changed files with 4 additions and 0 deletions
|
|
@ -111,6 +111,10 @@ func Install(ctx context.Context, m spec.JsonnetFile, dir string) (lock *spec.Js
|
||||||
}
|
}
|
||||||
|
|
||||||
func insertDependency(deps []spec.Dependency, newDep spec.Dependency) ([]spec.Dependency, error) {
|
func insertDependency(deps []spec.Dependency, newDep spec.Dependency) ([]spec.Dependency, error) {
|
||||||
|
if len(deps) == 0 {
|
||||||
|
return []spec.Dependency{newDep}, nil
|
||||||
|
}
|
||||||
|
|
||||||
res := []spec.Dependency{}
|
res := []spec.Dependency{}
|
||||||
for _, d := range deps {
|
for _, d := range deps {
|
||||||
if d.Name == newDep.Name {
|
if d.Name == newDep.Name {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue