Add utility function for simple package management

This commit is contained in:
2025-09-28 02:17:31 -04:00
parent 8b265cd3d9
commit f84f304466
6 changed files with 27 additions and 90 deletions
+8
View File
@@ -23,6 +23,14 @@ func manageService(action, service string) {
}
}
func managePackage(action, targetPackage string) {
cmd := exec.Command("pacman", action, targetPackage, "--noconfirm")
err := cmd.Run()
if err != nil {
other.PrintError("Failed to "+action+" "+targetPackage, 1)
}
}
func writeFile(path, data, owner string, perms os.FileMode) {
err := os.WriteFile(path, []byte(data), perms)
if err != nil {