mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-12 20:26:04 +08:00
fix(cli): pass PATH into child process
This commit is contained in:
Regular → Executable
+5
-3
@@ -4,7 +4,7 @@ import * as path from 'node:path';
|
|||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath } from 'node:url';
|
||||||
|
|
||||||
import * as p from '@clack/prompts';
|
import * as p from '@clack/prompts';
|
||||||
|
import os from 'os';
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
const __dirname = path.dirname(__filename);
|
const __dirname = path.dirname(__filename);
|
||||||
|
|
||||||
@@ -46,11 +46,13 @@ if (dev.server === 'local') {
|
|||||||
|
|
||||||
const env = {
|
const env = {
|
||||||
NODE_API_SERVER: dev.server,
|
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,
|
env,
|
||||||
cwd,
|
cwd,
|
||||||
stdio: 'inherit',
|
stdio: 'inherit',
|
||||||
|
|||||||
Reference in New Issue
Block a user