import { spawnSync } from 'node:child_process'; import { existsSync, readFileSync } from 'node:fs'; import { parseEnv } from 'node:util'; const overrides = existsSync('.env.estudio.local') ? parseEnv(readFileSync('.env.estudio.local', 'utf8')) : {}; const command = process.argv.slice(2); if (!command.length) throw new Error('Indica el comando que quieres ejecutar.'); const result = spawnSync(command[0], command.slice(1), { stdio: 'inherit', shell: process.platform === 'win32', env: { ...process.env, ...overrides, APP: 'estudio' } }); process.exit(result.status ?? 1);