Merge pull request #122 from fsolla/cursor/fix-deploy-cooldown-dotenv-1749

fix(ci) — deploy cooldown script without pnpm install
This commit is contained in:
Francisco Solla 2026-08-01 11:14:35 -03:00 committed by GitHub
commit 78b0b74cc2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,9 +8,10 @@
*/
import { createHash } from 'node:crypto'
import { access, mkdir, readFile, writeFile } from 'node:fs/promises'
import { createRequire } from 'node:module'
import { dirname, join } from 'node:path'
import { config as loadEnv } from 'dotenv'
const require = createRequire(import.meta.url)
/** Labelled `die` factory: `dieWithLabel('seed:tse')` → the script's `die`. */
export const dieWithLabel = (label) => (message) => {
@ -22,6 +23,7 @@ export const sha256Hex = (buffer) => createHash('sha256').update(buffer).digest(
/** The dotenv preamble every DB-touching script needs (.env.local wins over .env). */
export const loadCliEnv = () => {
const { config: loadEnv } = require('dotenv')
loadEnv({ path: '.env.local' })
loadEnv({ path: '.env' })
}