all repos — website @ 2d40fe2ceb36391cd2049f2f8689a9123bf024be

My website

Fix TypeScript warning about `env` access
Alan Pearce alan@alanpearce.eu
Tue, 09 Apr 2024 11:52:56 +0200
commit

2d40fe2ceb36391cd2049f2f8689a9123bf024be

parent

3cc18d65200cfa3f30a621f110292561b823089d

3 files changed, 4 insertions(+), 4 deletions(-)

jump to
M bin/build.tsbin/build.ts
@@ -4,7 +4,7 @@ import log from "loglevel"; 
 import generateSite from "../src/templates";
 
-log.setLevel((import.meta.env.LOG_LEVEL || "info") as log.LogLevelDesc);
+log.setLevel((import.meta.env["LOG_LEVEL"] || "info") as log.LogLevelDesc);
 
 fs.mkdirSync("public", { recursive: true });
 log.info("Generating site...");
M src/app.tssrc/app.ts
@@ -8,10 +8,10 @@ import log from "loglevel"; 
 import config from "./config";
 
-log.setLevel((import.meta.env.LOG_LEVEL || "info") as log.LogLevelDesc);
+log.setLevel((import.meta.env["LOG_LEVEL"] || "info") as log.LogLevelDesc);
 
 Sentry.init({
-  release: `homestead@${import.meta.env.FLY_MACHINE_VERSION}`,
+  release: `homestead@${import.meta.env["FLY_MACHINE_VERSION"]}`,
   tracesSampleRate: 1.0,
 });
 
M src/index.tssrc/index.ts
@@ -2,7 +2,7 @@ import log from "loglevel"; 
 import { server, metricsServer } from "./app";
 
-log.setLevel((import.meta.env.LOG_LEVEL || "info") as log.LogLevelDesc);
+log.setLevel((import.meta.env["LOG_LEVEL"] || "info") as log.LogLevelDesc);
 
 const metricsServed = Bun.serve(metricsServer);
 console.info(`Metrics server started on port ${metricsServed.port}`);