From 8b9629c8106b55965ac6e4f078110b484b358101 Mon Sep 17 00:00:00 2001 From: lauren Date: Wed, 23 Apr 2025 21:55:24 -0400 Subject: [PATCH] [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 --- compiler/scripts/copyright.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/scripts/copyright.js b/compiler/scripts/copyright.js index da3c39fe85..0a5ef2e29a 100644 --- a/compiler/scripts/copyright.js +++ b/compiler/scripts/copyright.js @@ -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) {