diff --git a/pkg/downloader/manager.go b/pkg/downloader/manager.go index 8aacfde7c..4ae63438d 100644 --- a/pkg/downloader/manager.go +++ b/pkg/downloader/manager.go @@ -690,11 +690,11 @@ func copyFile(source string, destination string) (err error) { _, err = io.Copy(destinationFile, sourceFile) if err == nil { stats, err := os.Stat(source) - if err != nil { - err = os.Chmod(destination, stats.Mode()) + if err == nil { + return os.Chmod(destination, stats.Mode()) } } - return + return err } func copyDir(source string, destination string) (err error) {