private function fatal($exception, $message = null, $trace = false) { fwrite(STDERR, "aborted!\n"); if (!$message) { $message = $exception->getMessage(); } if (!$message) { $message = get_class($exception); } if (Utils::is_tty()) { fwrite(STDERR, "[0;31m{$message}[0m"); } else { fwrite(STDERR, $message); } fwrite(STDERR, "\n\n"); if ($trace) { fwrite(STDERR, $exception->getTraceAsString() . "\n"); } else { fwrite(STDERR, "(See full trace by running task with --trace)\n"); } die(1); }
function bold($str) { return \phake\Utils::is_tty() ? "[1m{$str}[2m" : $str; }