File tree Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " create-better-t-stack " : patch
3+ ---
4+
5+ add small title for shorter window
Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ async function gatherConfig(
189189async function main ( ) {
190190 const s = spinner ( ) ;
191191 try {
192- console . clear ( ) ;
192+ process . stdout . write ( "\x1Bc" ) ;
193193 renderTitle ( ) ;
194194 intro ( chalk . bold ( "Creating a new Better-T Stack project" ) ) ;
195195 program
Original file line number Diff line number Diff line change @@ -18,6 +18,20 @@ const catppuccinTheme = {
1818} ;
1919
2020export const renderTitle = ( ) => {
21- const catppuccinGradient = gradient ( Object . values ( catppuccinTheme ) ) ;
22- console . log ( catppuccinGradient . multiline ( TITLE_TEXT ) ) ;
21+ const terminalWidth = process . stdout . columns || 80 ;
22+ const titleLines = TITLE_TEXT . split ( "\n" ) ;
23+ const titleWidth = Math . max ( ...titleLines . map ( ( line ) => line . length ) ) ;
24+
25+ if ( terminalWidth < titleWidth ) {
26+ const simplifiedTitle = `
27+ ╔══════════════════╗
28+ ║ Better T-Stack ║
29+ ╚══════════════════╝
30+ ` ;
31+ console . log (
32+ gradient ( Object . values ( catppuccinTheme ) ) . multiline ( simplifiedTitle ) ,
33+ ) ;
34+ } else {
35+ console . log ( gradient ( Object . values ( catppuccinTheme ) ) . multiline ( TITLE_TEXT ) ) ;
36+ }
2337} ;
You can’t perform that action at this time.
0 commit comments