From e1062e73252034b48f909a881328513a9fbba52f Mon Sep 17 00:00:00 2001 From: Jason Dobies Date: Wed, 12 Jun 2024 13:18:29 -0400 Subject: [PATCH] changed os-files implementation to use the existing CopyFiles function --- pkg/combustion/osfiles.go | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/pkg/combustion/osfiles.go b/pkg/combustion/osfiles.go index 63b7a8f1..c7f063e1 100644 --- a/pkg/combustion/osfiles.go +++ b/pkg/combustion/osfiles.go @@ -3,9 +3,7 @@ package combustion import ( _ "embed" "fmt" - "io" "os" - "os/exec" "path/filepath" "github.com/suse-edge/edge-image-builder/pkg/fileio" @@ -73,23 +71,13 @@ func copyOSFiles(ctx *image.Context) error { } }() - cmd := generateOSFilesCopyCommand(srcDirectory, destDirectory, logFile) - if err := cmd.Run(); err != nil { + if err := fileio.CopyFiles(srcDirectory, destDirectory, "", true); err != nil { return fmt.Errorf("running copy os-files command: %w", err) } return nil } -func generateOSFilesCopyCommand(srcDirectory string, destDirectory string, output io.Writer) *exec.Cmd { - cmd := exec.Command("cp", "-R", srcDirectory, destDirectory) - - cmd.Stdout = output - cmd.Stderr = output - - return cmd -} - func writeOSFilesScript(ctx *image.Context) error { osFilesScriptFilename := filepath.Join(ctx.CombustionDir, osFilesScriptName)