add more verbose output support

This commit is contained in:
Daylin Morgan 2024-05-22 10:57:30 -05:00
parent 7e15843425
commit 4150669d29
Signed by: daylin
GPG key ID: 950D13E9719334AD

View file

@ -17,6 +17,7 @@ import (
"github.com/briandowns/spinner" "github.com/briandowns/spinner"
) )
// verbose vs debug?
type Oizys struct { type Oizys struct {
flake string flake string
host string host string
@ -229,6 +230,10 @@ func (o *Oizys) NixosRebuild(subcmd string, rest ...string) {
o.flake, o.flake,
} }
args = append(args, rest...) args = append(args, rest...)
if o.verbose {
args = append(args, "--verbose")
fmt.Println("CMD:", "sudo", strings.Join(args, " "))
}
cmd := exec.Command("sudo", args...) cmd := exec.Command("sudo", args...)
runCommand(cmd) runCommand(cmd)
} }