Spaces:
Running
Running
Download scripts/setup-env.mjs from kishankrish19/nexus-tts-engine: direct link, hf CLI and curl.
- Browser
- Download file 475 Bytes
-
https://huggingface.co/spaces/kishankrish19/nexus-tts-engine/resolve/main/scripts/setup-env.mjs
- Command line
-
hf download hf://spaces/kishankrish19/nexus-tts-engine/scripts/setup-env.mjs
-
curl -L -o setup-env.mjs https://huggingface.co/spaces/kishankrish19/nexus-tts-engine/resolve/main/scripts/setup-env.mjs
475 Bytes
| import { existsSync, readFileSync, writeFileSync } from 'node:fs'; | |
| import { randomBytes } from 'node:crypto'; | |
| if (existsSync('.env')) { | |
| console.log('.env already exists; preserved.'); | |
| process.exit(0); | |
| } | |
| writeFileSync( | |
| '.env', | |
| readFileSync('.env.example', 'utf8').replace( | |
| /^MASTER_KEY=\s*$/m, | |
| `MASTER_KEY=${randomBytes(32).toString('hex')}`, | |
| ), | |
| { mode: 0o600 }, | |
| ); | |
| console.log('Created .env. Set ADMIN_EMAIL and a strong ADMIN_PASSWORD before seeding.'); | |