Skip to content

Commit 572e74f

Browse files
committed
feat: add a nice display banner with colored output
Signed-off-by: otengkwame <[email protected]>
1 parent 4c98541 commit 572e74f

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Core/core/Console/Console.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,31 @@ protected static function userConstants()
6363
return (object) get_defined_constants(true)['user'];
6464
}
6565

66+
/**
67+
* Display CLI banner
68+
*/
69+
public static function displayBanner(): void
70+
{
71+
static $displayed = false;
72+
73+
if ($displayed) {
74+
return;
75+
}
76+
77+
$banner = <<<BANNER
78+
79+
╦ ╦┌─┐┌┐ ┌┐ ┬ ┬ ╔═╗╦ ╦
80+
║║║├┤ ├┴┐├┴┐└┬┘ ║ ║ ║
81+
╚╩╝└─┘└─┘└─┘ ┴ ╚═╝╩═╝╩
82+
83+
BANNER;
84+
85+
echo ConsoleColor::cyan($banner);
86+
echo ConsoleColor::dim("\t\t\tv" . WEBBY_VERSION . "\n\n");
87+
88+
$displayed = true;
89+
}
90+
6691
/**
6792
* Webby Cli welcome message
6893
*

0 commit comments

Comments
 (0)