From de69f88642f21e8c0d531e5f103b68c6e5288385 Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Tue, 17 Sep 2024 09:11:35 -0600 Subject: [PATCH] fixup into more consistent version checking --- src/build/stable/utils/versions/dfx.ts | 4 +++- src/build/stable/utils/versions/node.ts | 4 +++- src/build/stable/utils/versions/rust.ts | 4 +++- src/build/stable/utils/versions/wasi2ic.ts | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/build/stable/utils/versions/dfx.ts b/src/build/stable/utils/versions/dfx.ts index c71a83d6d1..3f86ad5c34 100644 --- a/src/build/stable/utils/versions/dfx.ts +++ b/src/build/stable/utils/versions/dfx.ts @@ -22,4 +22,6 @@ function main(): void { } } -main(); +if (require.main === module) { + main(); +} diff --git a/src/build/stable/utils/versions/node.ts b/src/build/stable/utils/versions/node.ts index ab5764ea39..4aa213a9f9 100644 --- a/src/build/stable/utils/versions/node.ts +++ b/src/build/stable/utils/versions/node.ts @@ -21,4 +21,6 @@ function main(): void { } } -main(); +if (require.main === module) { + main(); +} diff --git a/src/build/stable/utils/versions/rust.ts b/src/build/stable/utils/versions/rust.ts index 5943d98a45..4cf87a0918 100644 --- a/src/build/stable/utils/versions/rust.ts +++ b/src/build/stable/utils/versions/rust.ts @@ -21,4 +21,6 @@ function main(): void { } } -main(); +if (require.main === module) { + main(); +} diff --git a/src/build/stable/utils/versions/wasi2ic.ts b/src/build/stable/utils/versions/wasi2ic.ts index 96144be2ff..0ecc54e461 100644 --- a/src/build/stable/utils/versions/wasi2ic.ts +++ b/src/build/stable/utils/versions/wasi2ic.ts @@ -34,4 +34,6 @@ function main(): void { } } -main(); +if (require.main === module) { + main(); +}