mirror of
https://github.com/EnumeratedDev/bpm.git
synced 2026-09-16 02:26:12 +00:00
Fix error when installing, updating or remove packages
This commit is contained in:
@@ -870,6 +870,16 @@ func installPackage(filename, rootDir string, verbose, force bool) error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure local package information has been initialized for rootDir
|
||||
err = initializeLocalPackageInformation(rootDir)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Add or update package information for rootDir
|
||||
localPackageInformation[rootDir][bpmpkg.PkgInfo.Name] = bpmpkg
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -999,5 +1009,14 @@ func removePackage(pkg string, verbose bool, rootDir string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Ensure local package information has been initialized for rootDir
|
||||
err = initializeLocalPackageInformation(rootDir)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Add or update package information for rootDir
|
||||
delete(localPackageInformation[rootDir], pkgInfo.Name)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user