CG-Feedback-Monitor/server/scripts/teamSetup.ts

19 lines
618 B
TypeScript
Raw Normal View History

/**
* Einmal-Setup für Team-ZIP: Starter-Struktur in die V2-Dev-DB laden.
* Usage: npm run setup
*/
import { existsSync, copyFileSync } from 'node:fs'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
const rootPath = join(dirname(fileURLToPath(import.meta.url)), '../..')
const envPath = join(rootPath, '.env')
const examplePath = join(rootPath, '.env.example')
if (!existsSync(envPath) && existsSync(examplePath)) {
copyFileSync(examplePath, envPath)
console.log('[setup] .env aus .env.example angelegt.')
}
process.env.CONFIRM = '1'
await import('./bootstrapFromStarter')