mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-25 02:33:05 +00:00
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:
commit
78b0b74cc2
1 changed files with 3 additions and 1 deletions
|
|
@ -8,9 +8,10 @@
|
||||||
*/
|
*/
|
||||||
import { createHash } from 'node:crypto'
|
import { createHash } from 'node:crypto'
|
||||||
import { access, mkdir, readFile, writeFile } from 'node:fs/promises'
|
import { access, mkdir, readFile, writeFile } from 'node:fs/promises'
|
||||||
|
import { createRequire } from 'node:module'
|
||||||
import { dirname, join } from 'node:path'
|
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`. */
|
/** Labelled `die` factory: `dieWithLabel('seed:tse')` → the script's `die`. */
|
||||||
export const dieWithLabel = (label) => (message) => {
|
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). */
|
/** The dotenv preamble every DB-touching script needs (.env.local wins over .env). */
|
||||||
export const loadCliEnv = () => {
|
export const loadCliEnv = () => {
|
||||||
|
const { config: loadEnv } = require('dotenv')
|
||||||
loadEnv({ path: '.env.local' })
|
loadEnv({ path: '.env.local' })
|
||||||
loadEnv({ path: '.env' })
|
loadEnv({ path: '.env' })
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue