diff --git a/src/flags.ts b/src/flags.ts index 80920d2..bbdbea2 100644 --- a/src/flags.ts +++ b/src/flags.ts @@ -7,7 +7,7 @@ import { _process } from "./process"; export const platform = _process.platform || ""; /** Current provider info */ -export const providerInfo = detectProvider(env); +export const providerInfo = detectProvider(env, _process); export const provider: ProviderName = providerInfo.name; /** Detect if `CI` environment variable is set or a provider CI detected */ diff --git a/src/providers.ts b/src/providers.ts index b7a602b..97e9f43 100644 --- a/src/providers.ts +++ b/src/providers.ts @@ -102,6 +102,7 @@ export type ProviderInfo = { name: ProviderName; [meta: string]: any }; export function detectProvider( env: Record, + ctx: { versions?: Record } = {}, ): ProviderInfo { // Based on env for (const provider of providers) { @@ -115,7 +116,7 @@ export function detectProvider( } // Stackblitz / Webcontainer - if (env.SHELL && env.SHELL === "/bin/jsh") { + if (env.SHELL === "/bin/jsh" || ctx.versions?.webcontainer) { return { name: "stackblitz", ci: false,