feat: add lab SQLite migrate, LiteLLM env, and OTEL/Grafana stack
sonar / sonar (push) Skipped
sonar / sonar (pull_request) Failing after 40s
sonar / sonar (push) Skipped
sonar / sonar (pull_request) Failing after 40s
Enable local workshop readiness with executable SQLite migrations, OpenTelemetry hello signals, and a provisioned Grafana demo dashboard over Tempo/Loki/Prometheus. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
|
||||
/** Load `.env` into process.env without overriding existing vars. */
|
||||
export function loadDotEnv(cwd = process.cwd()): void {
|
||||
try {
|
||||
const text = readFileSync(join(cwd, ".env"), "utf8");
|
||||
for (const line of text.split(/\r?\n/)) {
|
||||
const trimmed = line.trim();
|
||||
if (!trimmed || trimmed.startsWith("#")) continue;
|
||||
const i = trimmed.indexOf("=");
|
||||
if (i <= 0) continue;
|
||||
const key = trimmed.slice(0, i).trim();
|
||||
const value = trimmed.slice(i + 1).trim();
|
||||
if (process.env[key] === undefined) process.env[key] = value;
|
||||
}
|
||||
} catch {
|
||||
// optional .env
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user