mirror of
https://github.com/TECHNOFAB11/jsonnet-bundler.git
synced 2025-12-12 16:10:04 +01:00
Merge pull request #14 from brancz/fix-moving-locked-deps
pkg: Correctly move locked dependencies
This commit is contained in:
commit
e581455455
1 changed files with 17 additions and 17 deletions
|
|
@ -59,23 +59,6 @@ func Install(ctx context.Context, isLock bool, dependencySourceIdentifier string
|
||||||
return nil, errors.Wrap(err, "failed to install package")
|
return nil, errors.Wrap(err, "failed to install package")
|
||||||
}
|
}
|
||||||
|
|
||||||
// If dependencies are being installed from a lock file, the transitive
|
|
||||||
// dependencies are not questioned, but the locked dependencies are
|
|
||||||
// just installed.
|
|
||||||
if isLock {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
lock.Dependencies, err = insertDependency(lock.Dependencies, spec.Dependency{
|
|
||||||
Name: dep.Name,
|
|
||||||
Source: dep.Source,
|
|
||||||
Version: lockVersion,
|
|
||||||
DepSource: dependencySourceIdentifier,
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.Wrap(err, "failed to insert dependency to lock dependencies")
|
|
||||||
}
|
|
||||||
|
|
||||||
destPath := path.Join(dir, dep.Name)
|
destPath := path.Join(dir, dep.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "failed to find destination path for package")
|
return nil, errors.Wrap(err, "failed to find destination path for package")
|
||||||
|
|
@ -95,6 +78,23 @@ func Install(ctx context.Context, isLock bool, dependencySourceIdentifier string
|
||||||
return nil, errors.Wrap(err, "failed to move package")
|
return nil, errors.Wrap(err, "failed to move package")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lock.Dependencies, err = insertDependency(lock.Dependencies, spec.Dependency{
|
||||||
|
Name: dep.Name,
|
||||||
|
Source: dep.Source,
|
||||||
|
Version: lockVersion,
|
||||||
|
DepSource: dependencySourceIdentifier,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrap(err, "failed to insert dependency to lock dependencies")
|
||||||
|
}
|
||||||
|
|
||||||
|
// If dependencies are being installed from a lock file, the transitive
|
||||||
|
// dependencies are not questioned, the locked dependencies are just
|
||||||
|
// installed.
|
||||||
|
if isLock {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
filepath, isLock, err := ChooseJsonnetFile(destPath)
|
filepath, isLock, err := ChooseJsonnetFile(destPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue