Skip to content

Commit

Permalink
fix: CopyToSystem now correctly uses ExecAndLogSudo
Browse files Browse the repository at this point in the history
  • Loading branch information
HikariKnight committed Jul 27, 2024
1 parent 6c48a35 commit 380c875
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions internal/configs/configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"os"
"path/filepath"
"regexp"
"strings"

"github.com/klauspost/cpuid/v2"

Expand Down Expand Up @@ -317,10 +316,7 @@ func CopyToSystem(isRoot bool, conffile, sysfile string) {
conffile, _ = filepath.Abs(conffile)
}

conffile = strings.ReplaceAll(conffile, " ", "\\ ")
cmd := fmt.Sprintf("cp -v %s %s", conffile, sysfile)

err := command.ExecAndLogSudo(isRoot, false, cmd)
err := command.ExecAndLogSudo(isRoot, false, "cp", "-v", conffile, sysfile)

errMsg := ""
if err != nil {
Expand Down

0 comments on commit 380c875

Please sign in to comment.