diff --git a/tools/getPR.sh b/tools/getPR.sh new file mode 100644 index 00000000..e0fd813d --- /dev/null +++ b/tools/getPR.sh @@ -0,0 +1,17 @@ + +#!/bin/bash + +# pr 日志生成器 +# run $ bash tools/getPR.sh + +# git log --pretty="%h - %s - %ad" --author=ryan --since=2.weeks --no-merges > tools/log.txt + +logs=`git log --date=iso --since=2.weeks --no-merges --pretty=format:'{"commit": "-%h","author": "%aN <%aE>","date": "%ad","message": "%s"},'` + +log1=${logs} + +# echo ${log1%*,} + +echo '{"pr_req":['${log1%*,}']}' > tools/log.json + +node ./tools/parsLog.js \ No newline at end of file diff --git a/tools/log.json b/tools/log.json new file mode 100644 index 00000000..0fb7f370 --- /dev/null +++ b/tools/log.json @@ -0,0 +1 @@ +{"pr_req":[{"commit": "-d83b61c","author": "ryan ","date": "2019-01-24 20:15:08 +0800","message": "Modfiy: cupertinoColors 颜色,文案"}, {"commit": "-5fc96f1","author": "ryan ","date": "2019-01-24 20:12:00 +0800","message": "Modfiy: cupertinoColors 颜色,文案"}, {"commit": "-5e18365","author": "sanfan.hx ","date": "2019-01-24 19:47:36 +0800","message": "feat(update: icons for widget):"}, {"commit": "-7642f96","author": "sanfan.hx ","date": "2019-01-24 18:51:44 +0800","message": "feat(add CupertinoTimerPickerDemo):"}, {"commit": "-e4c75b4","author": "ryan ","date": "2019-01-24 18:47:50 +0800","message": "Debug:消除 warn"}, {"commit": "-4e0b93b","author": "ryan ","date": "2019-01-24 01:31:33 +0800","message": "Modfiy:关于手册图标更换"}, {"commit": "-836d392","author": "ryan730 ","date": "2019-01-24 01:16:46 +0800","message": "文案描述"}, {"commit": "-8bfa1c5","author": "ryan ","date": "2019-01-24 01:09:33 +0800","message": "add: CupertinoPicker,CupertinoPopupSurface"}, {"commit": "-ed68719","author": "sanfan.hx ","date": "2019-01-23 20:58:45 +0800","message": "feat(CupertinoTabView demo):"}, {"commit": "-515325b","author": "yifeng.yl ","date": "2019-01-23 14:38:37 +0800","message": "fix:导航栏home返回报错"}, {"commit": "-6ef12a9","author": "yifeng.yl ","date": "2019-01-23 11:17:36 +0800","message": "fix:collection bug"}, {"commit": "-e4e521e","author": "ryan ","date": "2019-01-23 01:49:04 +0800","message": "add: CupertinoNavigationBar CupertinoPageRoute CupertinoPageScaffold"}, {"commit": "-30fc818","author": "hanxu317317 ","date": "2019-01-22 11:12:47 +0800","message": "Update README-en.md"}, {"commit": "-5148fc4","author": "sanfan.hx ","date": "2019-01-22 11:03:36 +0800","message": "feat(add English intro from Allsimon pull request):"}, {"commit": "-740691d","author": "sanfan.hx ","date": "2019-01-21 13:23:29 +0800","message": "feat(add CupertinoTabScaffold):"}, {"commit": "-e7e2e6d","author": "ryan ","date": "2019-01-21 11:17:53 +0800","message": "Cupertino 的子项"}, {"commit": "-65e3819","author": "sanfan.hx ","date": "2019-01-20 23:04:56 +0800","message": "feat(add CupertinoTabBar demo):"}, {"commit": "-d840088","author": "sanfan.hx ","date": "2019-01-20 22:18:44 +0800","message": "feat(CupertinoSwitch demo):"}, {"commit": "-da964ef","author": "sanfan.hx ","date": "2019-01-20 17:24:59 +0800","message": "feat(为搜索列表加入icon)"}, {"commit": "-346036c","author": "sanfan.hx ","date": "2019-01-20 17:24:25 +0800","message": "feat(CupertinoSliverRefreshControl demo)"}, {"commit": "-0f8395d","author": "sanfan.hx ","date": "2019-01-20 16:25:17 +0800","message": "feat(CupertinoSliverNavigationBar demo):"}, {"commit": "-2f15d3b","author": "liming <327135508@qq.com>","date": "2019-01-19 16:31:07 +0800","message": "Update index.dart"}, {"commit": "-d0403c5","author": "sanfan.hx ","date": "2019-01-18 16:37:17 +0800","message": "add(CupertinoSegmentedControl demo && CupertinoSlider demo)"}, {"commit": "-00e65a9","author": "xiaojia22326@163.com ","date": "2019-01-18 15:42:18 +0800","message": "update SharedPreferences save data and android device layout overflow"}, {"commit": "-f051627","author": "sanfan.hx ","date": "2019-01-18 15:31:14 +0800","message": "feat(add CupertinoScrollbar demo):"}, {"commit": "-44b1f6f","author": "sanfan.hx ","date": "2019-01-18 14:38:56 +0800","message": "feat(第四页暂时用欢迎页替代. 后期再开发):"}, {"commit": "-e1a9cb6","author": "xiaojia22326@163.com ","date": "2019-01-17 16:14:07 +0800","message": "add license"}, {"commit": "-5a79032","author": "ryan730 ","date": "2019-01-17 15:20:50 +0800","message": "+LICENSE"}, {"commit": "-bf3e0d4","author": "sanfan.hx ","date": "2019-01-16 15:48:43 +0800","message": "feat(加入欢迎页):"}, {"commit": "-c5d69ad","author": "Allsimon ","date": "2019-01-16 16:15:58 +0100","message": "translate: translate the README to En locale"}, {"commit": "-9f8a164","author": "sanfan.hx ","date": "2019-01-16 10:25:28 +0800","message": "feat(CupertinoScrollbar demo):"}, {"commit": "-918b7f9","author": "sanfan.hx ","date": "2019-01-15 22:32:01 +0800","message": "temp"}, {"commit": "-c938008","author": "yifeng.yl ","date": "2019-01-15 10:56:29 +0800","message": "feat:数据库更新 cupertino 组件"}, {"commit": "-c3e7901","author": "sanfan.hx ","date": "2019-01-15 10:16:31 +0800","message": "feat(welcomepage):"}, {"commit": "-5dd2d87","author": "ryan730 ","date": "2019-01-14 23:00:19 +0800","message": "Add: 增加手册页面"}, {"commit": "-bd2253e","author": "sanfan.hx ","date": "2019-01-14 22:58:36 +0800","message": "feat(text demo): ;"}, {"commit": "-77246e5","author": "ryan730 ","date": "2019-01-14 22:32:10 +0800","message": "Add: 增加手册页面"}, {"commit": "-ceb347f","author": "yifeng.yl ","date": "2019-01-14 20:10:30 +0800","message": "refactor:modified icons"}, {"commit": "-c796e82","author": "yifeng.yl ","date": "2019-01-14 20:07:22 +0800","message": "refactor:文档、文章、组件收藏、新增webView"}, {"commit": "-ea9d09a","author": "yifeng.yl ","date": "2019-01-14 17:23:47 +0800","message": "refactor:modified demo"}, {"commit": "-441ed56","author": "yifeng.yl ","date": "2019-01-14 17:15:15 +0800","message": "refactor:code view"}, {"commit": "-dad59ed","author": "sanfan.hx ","date": "2019-01-14 16:15:17 +0800","message": "update(version) and readme.md"}, {"commit": "-5da3b4c","author": "yifeng.yl ","date": "2019-01-14 16:15:16 +0800","message": "modified : add code view"}, {"commit": "-c94fab6","author": "sanfan.hx ","date": "2019-01-14 14:50:23 +0800","message": "feat(add search history board;):"}, {"commit": "-2464c39","author": "sanfan.hx ","date": "2019-01-14 14:36:04 +0800","message": "temp"}, {"commit": "-fa3bec4","author": "ryan730 ","date": "2019-01-14 01:02:29 +0800","message": "Modify: List 加 header bug"}, {"commit": "-b43cd20","author": "ryan730 ","date": "2019-01-13 23:54:16 +0800","message": "Modfiy: 首页 轮播图 不置顶 免责 样式"}, {"commit": "-051d765","author": "xiaojia22326@163.com ","date": "2019-01-13 21:51:27 +0800","message": "add some input describe"}, {"commit": "-095387f","author": "sanfan.hx ","date": "2019-01-13 21:30:04 +0800","message": "feat(加入GridPaper&SliverGrid):"}, {"commit": "-2c2b7e7","author": "yifeng.yl ","date": "2019-01-13 21:20:23 +0800","message": "refactor:modified db"}, {"commit": "-2e4c0be","author": "yifeng.yl ","date": "2019-01-13 21:11:14 +0800","message": "refactor:modified db"}, {"commit": "-640e12c","author": "yifeng.yl ","date": "2019-01-13 20:57:32 +0800","message": "refactor:删除数据库:TabBarView"}, {"commit": "-0a3bd9b","author": "sanfan.hx ","date": "2019-01-13 19:57:50 +0800","message": "grid view"}, {"commit": "-5d88d0c","author": "ryan730 ","date": "2019-01-13 19:06:08 +0800","message": "Modify: checkbosListTile bug"}, {"commit": "-f4aac49","author": "ryan730 ","date": "2019-01-13 18:13:38 +0800","message": "Modfiy:自动提示文案"}, {"commit": "-7cf8d11","author": "ryan730 ","date": "2019-01-13 17:41:23 +0800","message": "feat(增加免责声明): 声明组件,自动弹出,左上角入口"}, {"commit": "-c120fd3","author": "sanfan.hx ","date": "2019-01-13 14:15:18 +0800","message": "refactor(整理数据库初始逻辑, 判断数据库完整性): 判断是否存在已知的cat, widget, collection三张表."}, {"commit": "-0b1cff5","author": "sanfan.hx ","date": "2019-01-13 12:43:41 +0800","message": "fix(修复DialogDemo, 无法关闭的问题):"}, {"commit": "-23d0698","author": "yifeng.yl ","date": "2019-01-12 21:19:47 +0800","message": "modified db"}, {"commit": "-b58e203","author": "ryan730 ","date": "2019-01-12 21:01:19 +0800","message": "Modfiy: icon 没有,但内容有的,组件,给补充了 icon"}, {"commit": "-164cb4f","author": "ryan730 ","date": "2019-01-12 20:26:28 +0800","message": "Modify: 1.整理文件 2.修正 analysis"}, {"commit": "-fbbd1f6","author": "sanfan.hx ","date": "2019-01-12 19:41:03 +0800","message": "update: flutter_rookie_book => flutter_go"}, {"commit": "-4e20d9c","author": "sanfan.hx ","date": "2019-01-12 19:22:33 +0800","message": "update: 更新SearchInput文件名 => search_input"}, {"commit": "-d42c5e0","author": "ryan730 ","date": "2019-01-12 18:12:47 +0800","message": "Modify:文件名称的大小写规范"}, {"commit": "-d8db19b","author": "ryan730 ","date": "2019-01-12 18:11:24 +0800","message": "Modify:文件名称的大小写规范"}, {"commit": "-e4df84c","author": "ryan730 ","date": "2019-01-12 18:09:40 +0800","message": "Modify:文件名称的大小写规范"}, {"commit": "-ae1e1d9","author": "ryan730 ","date": "2019-01-12 17:50:01 +0800","message": "Modify:修正 bottomNavigationBar iconButton 警告"}, {"commit": "-438977a","author": "xiaojia22326@163.com ","date": "2019-01-12 15:56:59 +0800","message": "delete code"}, {"commit": "-fd38286","author": "yifeng.yl ","date": "2019-01-12 15:43:59 +0800","message": "fix bur"}, {"commit": "-55b8be1","author": "yifeng.yl ","date": "2019-01-12 15:34:17 +0800","message": "collection"}, {"commit": "-69c4d5e","author": "xiaojia22326@163.com ","date": "2019-01-12 15:23:17 +0800","message": "modify some description"}]} diff --git a/tools/parsLog.js b/tools/parsLog.js new file mode 100644 index 00000000..ab6108a8 --- /dev/null +++ b/tools/parsLog.js @@ -0,0 +1,70 @@ +var path = require('path'); //系统路径模块 +var fs = require('fs'); //文件模块 +var http = require('http'); +var child_process = require('child_process'); + +var file = path.join(__dirname, './log.json'); //文件路径,__dirname为当前运行js文件的目录 + //读取json文件 +fs.readFile(file, 'utf-8', function(err, data) { + if (err) { + res.send('文件读取失败'); + } else { + // res.send(data); + if(data) { + const obj = JSON.parse(data); + const newObj ={}; + obj.pr_req.map((item,i)=>{ + const key = encodeURIComponent(item.message); + newObj[key] ={date: new Date(item.date).toLocaleDateString(),msg:item.message}; + }) + const newObjCategory = Object.values(newObj); + const categorys ={}; + newObjCategory.map((item)=>{ + if(!categorys[item.date]) { + categorys[item.date] =[]; + }else { + categorys[item.date].push(item.msg); + } + }) + //console.log('----------->',categorys); + rendHtml(categorys); + } + + } +}); + + +function rendHtml(categorys){ + http.createServer(function (req, res) { + var html = buildHtml(categorys); + res.writeHead(200, { + 'Content-Type': 'text/html;charset=utf-8', + //'Content-Length': html.length, + 'Expires': new Date().toUTCString() + }); + + res.end(html); + }).listen(8889,"127.0.0.1"); + + console.log("Server running at http://127.0.0.1:8889/"); + child_process.exec(`start "http://127.0.0.1:8080"`); + + function buildHtml(obj) { + var header = ''; + var body = ''; + var content = ''; + for(var i in obj) { + let liContent = `
    #### ${i}`; + const list = obj[i]; + list.map((it,index)=>{ + liContent += `
  •   - [x] ${it}
  • ` + }) + liContent += `
`; + + content += liContent; + } + // console.log('content===>',content) + return '' + + '
' + header + '
' + content + ''; + }; +} \ No newline at end of file