forked from Plemya-x/ALR
wip
This commit is contained in:
@ -20,6 +20,7 @@ import (
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// APTRpm represents the APT-RPM package manager
|
||||
@ -110,7 +111,11 @@ func (a *APTRpm) UpgradeAll(opts *Opts) error {
|
||||
func (a *APTRpm) getCmd(opts *Opts, mgrCmd string, args ...string) *exec.Cmd {
|
||||
var cmd *exec.Cmd
|
||||
if opts.AsRoot {
|
||||
cmd = exec.Command(getRootCmd(a.rootCmd), mgrCmd)
|
||||
if syscall.Geteuid() != 0 {
|
||||
cmd = exec.Command(getRootCmd(a.rootCmd), mgrCmd)
|
||||
} else {
|
||||
cmd = exec.Command(mgrCmd)
|
||||
}
|
||||
cmd.Args = append(cmd.Args, opts.Args...)
|
||||
cmd.Args = append(cmd.Args, args...)
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user