import { SpawnOptions } from 'child_process' ; import supportsColor from 'supports-color' ; export const getSpawnOpts = ( { colorSupport = supportsColor . stdout , cwd , process = global . process , raw = false , env = { } , } ) : SpawnOptions => Object . assign ( { cwd : cwd || process . cwd ( ) , } , raw && { stdio : 'inherit' as const } , /^win/ . test ( process . platform ) && { detached : false } , { env : Object . assign ( colorSupport ? { FORCE_COLOR : colorSupport . level } : { } , process . env , env ) } ) ;