Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mirkobrombin committed Apr 28, 2024
1 parent e5aa9f0 commit 1cef1e2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/packages.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,28 +237,28 @@ func (p *PackageManager) Remove(pkg string) error {
// specific feature, I'm leaving it as is for now.
err = p.ExistsInRepo(pkg)
if err != nil {
PrintVerboseErr("PackageManager.Remove", 2, err)
PrintVerboseErr("PackageManager.Remove", 1, err)
return err
}

// Add to unstaged packages first
upkgs, err := p.GetUnstagedPackages()
if err != nil {
PrintVerboseErr("PackageManager.Remove", 0, err)
PrintVerboseErr("PackageManager.Remove", 2, err)
return err
}
upkgs = append(upkgs, UnstagedPackage{pkg, REMOVE})
err = p.writeUnstagedPackages(upkgs)
if err != nil {
PrintVerboseErr("PackageManager.Remove", 1, err)
PrintVerboseErr("PackageManager.Remove", 3, err)
return err
}

// If package was added by the user, simply remove it from packages.add
// Unstaged will take care of the rest
pkgsAdd, err := p.GetAddPackages()
if err != nil {
PrintVerboseErr("PackageManager.Remove", 3, err)
PrintVerboseErr("PackageManager.Remove", 4, err)
return err
}
for i, ap := range pkgsAdd {
Expand All @@ -272,7 +272,7 @@ func (p *PackageManager) Remove(pkg string) error {
// Abort if package is already removed
pkgsRemove, err := p.GetRemovePackages()
if err != nil {
PrintVerboseErr("PackageManager.Remove", 4, err)
PrintVerboseErr("PackageManager.Remove", 5, err)
return err
}
for _, p := range pkgsRemove {
Expand Down

0 comments on commit 1cef1e2

Please sign in to comment.