You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
579 B
15 lines
579 B
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);
|