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"
)
// verbose vs debug?
type Oizys struct {
flake string
host string
@ -229,6 +230,10 @@ func (o *Oizys) NixosRebuild(subcmd string, rest ...string) {
o.flake,
}
args = append(args, rest...)
if o.verbose {
args = append(args, "--verbose")
fmt.Println("CMD:", "sudo", strings.Join(args, " "))
}
cmd := exec.Command("sudo", args...)
runCommand(cmd)
}