This repository was archived by the owner on Mar 6, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
src/main/java/org/code4everything/wetool/controller Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,9 @@ def package(os_name):
24
24
with open ('./src/main/resources/gitinfo' , 'w+' , encoding = 'utf-8' ) as fw :
25
25
branch = os .popen ('git symbolic-ref --short -q HEAD' ).read ().replace ('\n ' , '' )
26
26
last_commit = os .popen ('git rev-parse --short HEAD' ).read ().replace ('\n ' , '' )
27
- fw .write ("%s:%s" % (branch , last_commit ))
27
+ date = os .popen ('git log --pretty=format:"%%ct" %s -1' % last_commit ).read ().replace ('\n ' , '' )
28
+ info = os .popen ('git log --pretty=format:"%%s" %s -1' % last_commit ).read ().replace ('\n ' , '' )
29
+ fw .write ("%s:%s:%s:%s" % (branch , last_commit , date , info ))
28
30
29
31
package ('win' )
30
32
package ('mac' )
Original file line number Diff line number Diff line change @@ -229,6 +229,7 @@ private void registerActions() {
229
229
registerAction ("检查更新-checkforupdate" , actionEvent -> checkUpdate ());
230
230
registerAction ("隐藏-hide" , actionEvent -> FxUtils .hideStage ());
231
231
registerAction ("插件仓库-pluginrepository" , actionEvent -> FxUtils .openLink (TipConsts .REPO_LINK ));
232
+ registerAction ("关于-about" , event -> about ());
232
233
233
234
// 注册模式匹配动作
234
235
registerAction ("hutool *" , hutoolCmdHandler );
@@ -627,11 +628,15 @@ public void about() {
627
628
String gitInfo = StrUtil .trim (ResourceUtil .readUtf8Str ("gitinfo" ));
628
629
String aboutApp = TipConsts .ABOUT_APP ;
629
630
if (StrUtil .isNotEmpty (gitInfo ) && !StrUtil .startWith (gitInfo , "master" )) {
630
- List <String > infos = StrUtil .splitTrim (gitInfo , ":" );
631
+ List <String > infos = StrUtil .splitTrim (gitInfo , ":" , 4 );
631
632
aboutApp += "\r \n 开发版分支:" + infos .get (0 );
632
633
if (infos .size () > 1 ) {
633
634
aboutApp += ",提交:" + infos .get (1 );
634
635
}
636
+ if (infos .size () > 3 ) {
637
+ aboutApp += "\r \n 提交信息:" + infos .get (3 );
638
+ aboutApp += "\r \n \r \n 提交日期:" + DateUtil .formatDateTime (DateUtil .date (Long .parseLong (infos .get (2 )) * 1000 ));
639
+ }
635
640
aboutApp += "\r \n " ;
636
641
}
637
642
FxDialogs .showInformation (TitleConsts .ABOUT_APP , aboutApp );
You can’t perform that action at this time.
0 commit comments