(goctl)fix file copy permission missed (#5475)

This commit is contained in:
kesonan
2026-03-15 21:55:27 +08:00
committed by GitHub
parent d1a014955c
commit b01831b4c5
2 changed files with 128 additions and 1 deletions

View File

@@ -64,6 +64,15 @@ func fileCopy(file *zip.File, destPath string) error {
return err
}
defer w.Close()
_, err = io.Copy(w, rc)
return err
if err != nil {
return err
}
if file.Mode().IsRegular() && file.Mode()&0111 != 0 {
return w.Chmod(file.Mode())
}
return nil
}