Skip to main content

add colors when running composer

Comments

4 comments

  • katmai
    the answer came to me after i posted this thread. composer --ansi :)
    0
  • cPanelMichael
    Hello, I'm happy to see you were able to find the answer to your question. Thank you for updating us with the outcome.
    0
  • katmai
    I am still curious how you guys are doing it on cPanel though, because the way i did it was create a script that runs composer --ansi whenever i type "composer", however i see that on my cpanel box where there's composer, the colors show without me forcing --ansi : - Removed -
    0
  • cPanelMichael
    You can review Composer's installation file to see how they have it configured by default at: getcomposer.org/installer at master " composer/getcomposer.org " GitHub EX:
    /** * Sets the USE_ANSI define for colorizing output * * @param array $argv Command-line arguments */ function setUseAnsi($argv) { // --no-ansi wins over --ansi if (in_array('--no-ansi', $argv)) { define('USE_ANSI', false); } elseif (in_array('--ansi', $argv)) { define('USE_ANSI', true); } else { // On Windows, default to no ANSI, except in ANSICON and ConEmu. // Everywhere else, default to ANSI if stdout is a terminal. define( 'USE_ANSI', (DIRECTORY_SEPARATOR == '\\') ? (false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI')) : (function_exists('posix_isatty') && posix_isatty(1)) ); } } /**
    Thank you.
    0

Please sign in to leave a comment.