mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-25 16:36:34 -05:00
fix(telemetry): process referenced on non-nodejs runtime (#4007)
* process in cf worker * lint
This commit is contained in:
committed by
Bereket Engida
parent
3857c57c16
commit
8023a72c0d
@@ -1,7 +1,8 @@
|
||||
// https://github.com/zkochan/packages/blob/main/which-pm-runs/index.js
|
||||
export function detectPackageManager() {
|
||||
const userAgent = process.env.npm_config_user_agent;
|
||||
import { env } from "../../utils/env";
|
||||
|
||||
export function detectPackageManager() {
|
||||
const userAgent = env.npm_config_user_agent;
|
||||
if (!userAgent) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -91,7 +91,10 @@ export async function detectSystemInfo() {
|
||||
memory: os.totalmem(),
|
||||
isWSL: await isWsl(),
|
||||
isDocker: await isDocker(),
|
||||
isTTY: process.stdout.isTTY,
|
||||
isTTY:
|
||||
typeof process !== "undefined" && (process as any).stdout
|
||||
? (process as any).stdout.isTTY
|
||||
: null,
|
||||
};
|
||||
} catch (e) {
|
||||
return {
|
||||
@@ -150,7 +153,7 @@ async function isDocker() {
|
||||
async function isWsl() {
|
||||
try {
|
||||
if (getVendor() === "cloudflare") return false;
|
||||
if (process.platform !== "linux") {
|
||||
if (typeof process === "undefined" || process.platform !== "linux") {
|
||||
return false;
|
||||
}
|
||||
const importRuntime = (m: string) =>
|
||||
|
||||
Reference in New Issue
Block a user