[compiler] Fix copyright script (#33003)

Don't try to open directories
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/33003).
* #33004
* __->__ #33003
* #33002

---------

Co-authored-by: Jordan Brown <jmbrown@meta.com>
This commit is contained in:
lauren 2025-04-23 21:55:24 -04:00 committed by GitHub
parent 3a5335676f
commit 8b9629c810
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,6 +51,9 @@ if (hasErrors) {
}
function processFile(file) {
if (fs.lstatSync(file).isDirectory()) {
return;
}
let source = fs.readFileSync(file, 'utf8');
if (source.indexOf(META_COPYRIGHT_COMMENT_BLOCK) === 0) {