mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-07-28 21:24:38 +02:00
fix: ensure color output for child processes in Windows environment (#17695)
This commit is contained in:
@@ -31,6 +31,9 @@ let shutdownPromise = null;
|
||||
*/
|
||||
function spawnChildProcess(command, args, options) {
|
||||
const isWindows = process.platform === 'win32';
|
||||
const shouldForceColor = (process.stdout.isTTY || process.stderr.isTTY)
|
||||
&& process.env.FORCE_COLOR == null
|
||||
&& process.env.NO_COLOR == null;
|
||||
const pnpmPath = _dirname + '/../node_modules/pnpm/bin/pnpm.mjs';
|
||||
const windowsCommand = [process.execPath, pnpmPath, ...args]
|
||||
.map(argument => `"${argument}"`)
|
||||
@@ -45,6 +48,7 @@ function spawnChildProcess(command, args, options) {
|
||||
// Ctrl+C, allowing only this supervisor to coordinate the shutdown.
|
||||
windowsVerbatimArguments: true,
|
||||
windowsHide: false,
|
||||
env: shouldForceColor ? { FORCE_COLOR: '1' } : undefined,
|
||||
stdout: 'pipe',
|
||||
stderr: 'pipe',
|
||||
buffer: false,
|
||||
|
||||
Reference in New Issue
Block a user