We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0219c24 commit 9637e89Copy full SHA for 9637e89
apt.go
@@ -124,3 +124,16 @@ func Remove(packs ...*Package) (output []byte, err error) {
124
cmd := exec.Command("apt-get", args...)
125
return cmd.CombinedOutput()
126
}
127
+
128
+// Install installs a set of packages
129
+func Install(packs ...*Package) (output []byte, err error) {
130
+ args := []string{"install", "-y"}
131
+ for _, pack := range packs {
132
+ if pack == nil || pack.Name == "" {
133
+ return nil, fmt.Errorf("apt.Install: Invalid package with empty Name")
134
+ }
135
+ args = append(args, pack.Name)
136
137
+ cmd := exec.Command("apt-get", args...)
138
+ return cmd.CombinedOutput()
139
+}
0 commit comments