@@ -59,34 +59,36 @@ export const ValidatedRepoMeta = () => {
59
59
60
60
const showBanner = ( ) => {
61
61
const { sha, tag, buildtime, repo, valid } = ValidatedRepoMeta ( )
62
- const rst = '\x1b[0m'
63
- const bold = '\x1b[1m'
64
- const brand = '\x1b[38;2;4;202;171m'
65
- const alert = '\x1b[38;2;254;48;48m'
66
62
const padding = ' ' . repeat ( 45 )
67
63
68
- const showtag = valid ? `${ brand } ${ tag } ` : `${ alert } Unknown`
69
- const commit = valid ? `${ brand } ${ sha } ` : `${ alert } Unofficial build version`
64
+ const bannerClr = [ 'color: #4ccaaa' , 'color: unset' ]
65
+ const textClr = [ 'font-weight: bold' , 'font-weight: bold; color: #4ccaaa' ]
66
+ const badClr = [ 'font-weight: bold' , 'font-weight: bold; color: #fe3030' ]
70
67
71
- const title = `
72
- ██████╗ ███████╗ ${ brand } ${ rst } ██████╗████████╗███████╗
73
- ██╔════╝ ╚══███╔╝ ${ brand } ██╗██╗ ${ rst } ██╔════╝╚══██╔══╝██╔════╝
74
- ██║ ███╗ ███╔╝ ${ brand } ╚═╝╚═╝ ${ rst } ██║ ██║ █████╗
75
- ██║ ██║ ███╔╝ ${ brand } ██╗██╗ ${ rst } ██║ ██║ ██╔══╝
76
- ╚██████╔╝███████╗ ${ brand } ╚═╝╚═╝ ${ rst } ╚██████╗ ██║ ██║
77
- ╚═════╝ ╚══════╝ ${ brand } ${ rst } ╚═════╝ ╚═╝ ╚═╝
68
+ const banner = `
69
+ ██████╗ ███████╗ ██████╗████████╗███████╗
70
+ ██╔════╝ ╚══███╔╝ %c ██╗██╗ %c ██╔════╝╚══██╔══╝██╔════╝
71
+ ██║ ███╗ ███╔╝ %c ╚═╝╚═╝ %c ██║ ██║ █████╗
72
+ ██║ ██║ ███╔╝ %c ██╗██╗ %c ██║ ██║ ██╔══╝
73
+ ╚██████╔╝███████╗ %c ╚═╝╚═╝ %c ╚██████╗ ██║ ██║
74
+ ╚═════╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝
75
+ ${ padding } %c@ %c${ valid ? tag : 'Unknown' }
78
76
79
- ${ padding } ${ bold } @ ${ showtag } ${ rst }
80
- `
77
+ %cCopyright (C) 2022-now, GZTimeWalker, All rights reserved.
81
78
79
+ %cLicense : %cGNU Affero General Public License v3.0
80
+ %cCommit : %c${ valid ? sha : 'Unofficial build version' }
81
+ %cBuilt at : %c${ buildtime . format ( 'YYYY-MM-DDTHH:mm:ssZ' ) }
82
+ %cIssues : %c${ repo } /issues
83
+ `
84
+
85
+ // rewrite the show banner function with %c and css
82
86
console . log (
83
- `${ title } ` +
84
- `\n${ bold } Copyright (C) 2022-now, GZTimeWalker, All rights reserved.${ rst } \n` +
85
- `\n${ bold } License : ${ brand } GNU Affero General Public License v3.0${ rst } ` +
86
- `\n${ bold } Commit : ${ commit } ${ rst } ` +
87
- `\n${ bold } Built at : ${ brand } ${ buildtime . format ( 'YYYY-MM-DDTHH:mm:ssZ' ) } ${ rst } ` +
88
- `\n${ bold } Issues : ${ repo } /issues` +
89
- '\n'
87
+ banner ,
88
+ ...bannerClr . concat ( bannerClr , bannerClr , bannerClr ) ,
89
+ ...( valid ? textClr : badClr ) ,
90
+ 'font-weight: bold' ,
91
+ ...textClr . concat ( valid ? textClr : badClr , textClr , textClr )
90
92
)
91
93
}
92
94
0 commit comments