Skip to content

Commit f5b4c32

Browse files
committed
Replace require check with import.meta.main
1 parent b813f91 commit f5b4c32

10 files changed

Lines changed: 10 additions & 10 deletions

‎pr-checks/bundle-changelog.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,6 @@ function main() {
122122
}
123123

124124
// Only call `main` if this script was run directly.
125-
if (require.main === module) {
125+
if (import.meta.main) {
126126
process.exit(main());
127127
}

‎pr-checks/bundle-metadata.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ async function main() {
4343
}
4444

4545
// Only call `main` if this script was run directly.
46-
if (require.main === module) {
46+
if (import.meta.main) {
4747
void main();
4848
}

‎pr-checks/check-repo-size.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,6 @@ async function run(): Promise<void> {
218218
}
219219
}
220220

221-
if (require.main === module) {
221+
if (import.meta.main) {
222222
void run();
223223
}

‎pr-checks/prepare-changelog.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,6 @@ function main() {
7777
}
7878

7979
// Only call `main` if this script was run directly.
80-
if (require.main === module) {
80+
if (import.meta.main) {
8181
process.exit(main());
8282
}

‎pr-checks/release-branches.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,6 @@ async function main() {
116116
}
117117

118118
// Only call `main` if this script was run directly.
119-
if (require.main === module) {
119+
if (import.meta.main) {
120120
void main();
121121
}

‎pr-checks/rollback-changelog.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@ function main() {
7979
}
8080

8181
// Only call `main` if this script was run directly.
82-
if (require.main === module) {
82+
if (import.meta.main) {
8383
process.exit(main());
8484
}

‎pr-checks/sync-back.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,6 @@ function main(): number {
232232
}
233233

234234
// Only call `main` if this script was run directly.
235-
if (require.main === module) {
235+
if (import.meta.main) {
236236
process.exit(main());
237237
}

‎pr-checks/sync-checks.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,6 @@ async function main(): Promise<void> {
342342
}
343343

344344
// Only call `main` if this script was run directly.
345-
if (require.main === module) {
345+
if (import.meta.main) {
346346
void main();
347347
}

‎pr-checks/update-ghes-versions.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,6 @@ function main() {
238238
}
239239

240240
// Only call `main` if this script was run directly.
241-
if (require.main === module) {
241+
if (import.meta.main) {
242242
main();
243243
}

‎pr-checks/update-release-branch.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,6 @@ async function main(): Promise<void> {
835835
}
836836

837837
// Only call `main` if this script was run directly.
838-
if (require.main === module) {
838+
if (import.meta.main) {
839839
void main();
840840
}

0 commit comments

Comments
 (0)