chore(debug): envs in api functions

This commit is contained in:
Michael Zetterberg
2024-05-17 15:26:25 +02:00
parent 62a8374144
commit f782ae796e
2 changed files with 9 additions and 2 deletions

2
env/server.ts vendored
View File

@@ -1,8 +1,6 @@
import { createEnv } from "@t3-oss/env-nextjs"
import { z } from "zod"
console.warn({ PROCESS_ENV: process.env })
export const env = createEnv({
/**
* Due to t3-env only checking typeof window === "undefined"

View File

@@ -32,6 +32,13 @@ if (!NEXTAUTH_URL) {
}
let contents = fs.readFileSync("./.env", { encoding: "utf-8" })
console.log({ pre_contents: contents })
console.log({
SCANDIC_ENV_URL,
NEXTAUTH_URL,
DEPLOY_PRIME_URL,
URL,
})
contents = contents.replace(
// 'URL="REPLACEME-ON-BUILD-ON-NETLIFY"',
@@ -45,4 +52,6 @@ contents = contents.replace(
`NEXTAUTH_URL="${NEXTAUTH_URL}"`
)
console.log({ post_contents: contents })
fs.writeFileSync("./.env", contents, { encoding: "utf-8" })