Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yup -c failed when there is no unused dependencies to uninstall #20

Closed
Galiley opened this issue Feb 12, 2020 · 0 comments · Fixed by #21
Closed

Yup -c failed when there is no unused dependencies to uninstall #20

Galiley opened this issue Feb 12, 2020 · 0 comments · Fixed by #21
Assignees
Labels
bug Something isn't working

Comments

@Galiley
Copy link

Galiley commented Feb 12, 2020

The issue is in the file clean/clean.go

// Clear unused packs
output.Printf("Finding unused dependencies")
pac := exec.Command("pacman", "-Qtdq")
var packs []string
if out, err := pac.Output(); err == nil {
	for _, pack := range strings.Split(string(out), "\n") {
		if len(pack) > 1 {
			packs = append(packs, pack)
		}
	}
}

When there is no unused dependencies, packs should be empty

packs = append([]string{"pacman", "-Rns"}, packs...)
rem := exec.Command("sudo", packs...)
output.SetStd(rem)
if err := rem.Run(); err != nil {
	return err
}


return nil

This statement should be run only if packs isn't empty.

@ericm ericm added the bug Something isn't working label Feb 12, 2020
@gal gal linked a pull request Feb 13, 2020 that will close this issue
@ericm ericm closed this as completed in #21 Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants