fix(cli): pass PATH into child process

This commit is contained in:
himself65
2023-03-21 23:00:54 -05:00
parent 215db27cd6
commit eb7d5fd7a1

8
packages/cli/src/dev.mjs Normal file → Executable file
View File

@@ -4,7 +4,7 @@ import * as path from 'node:path';
import { fileURLToPath } from 'node:url';
import * as p from '@clack/prompts';
import os from 'os';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
@@ -46,11 +46,13 @@ if (dev.server === 'local') {
const env = {
NODE_API_SERVER: dev.server,
PATH: process.env.PATH,
};
const cwd = path.resolve(__dirname, '..', '..', '..', 'apps', 'web');
const root = path.resolve(__dirname, '..', '..', '..');
const cwd = path.resolve(root, 'apps', 'web');
const process = spawn('yarn', ['dev'], {
spawn('yarn', ['dev'], {
env,
cwd,
stdio: 'inherit',