Skip to content

Commit 380c875

Browse files
committed
fix: CopyToSystem now correctly uses ExecAndLogSudo
1 parent 6c48a35 commit 380c875

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

internal/configs/configs.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"os"
77
"path/filepath"
88
"regexp"
9-
"strings"
109

1110
"github.com/klauspost/cpuid/v2"
1211

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

320-
conffile = strings.ReplaceAll(conffile, " ", "\\ ")
321-
cmd := fmt.Sprintf("cp -v %s %s", conffile, sysfile)
322-
323-
err := command.ExecAndLogSudo(isRoot, false, cmd)
319+
err := command.ExecAndLogSudo(isRoot, false, "cp", "-v", conffile, sysfile)
324320

325321
errMsg := ""
326322
if err != nil {

0 commit comments

Comments
 (0)