import { isCurrentBinInstalledGlobally } from './isCurrentBinInstalledGlobally' ; export function getCommandWithExecutor ( command ) { if ( isCurrentBinInstalledGlobally ( ) ) { return command ; } else { const yarnUsed = process . env . npm_config_user_agent ?. includes ( 'yarn' ) ; const npxUsed = __dirname . includes ( '_npx' ) ; if ( npxUsed ) { return `npx ${ command }` ; } else if ( yarnUsed ) { return `yarn ${ command }` ; } else { return command ; } } }