We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e13a3d2 commit 328e8c1Copy full SHA for 328e8c1
src/common/container.ts
@@ -1,6 +1,8 @@
1
import fs from "fs/promises";
2
3
-export async function detectContainerEnv(): Promise<boolean> {
+let containerEnv: boolean | undefined;
4
+
5
+async function internalDetectContainerEnv(): Promise<boolean> {
6
if (process.platform !== "linux") {
7
return false; // we only support linux containers for now
8
}
@@ -22,3 +24,12 @@ export async function detectContainerEnv(): Promise<boolean> {
22
24
23
25
return exists.includes(true);
26
27
28
+export async function detectContainerEnv(): Promise<boolean> {
29
+ if (containerEnv !== undefined) {
30
+ return containerEnv;
31
+ }
32
33
+ containerEnv = await internalDetectContainerEnv();
34
35
+}
0 commit comments