Browse Source

调试界面输出版本信息

pull/76/head
liwei 3 years ago
parent
commit
143f9c7dde
6 changed files with 8 additions and 19 deletions
  1. +1
    -1
      public/index.html
  2. +1
    -0
      public/version.log.js
  3. +3
    -5
      version.js
  4. +1
    -0
      version.log.js
  5. +0
    -12
      version.txt
  6. +2
    -1
      vue.config.js

+ 1
- 1
public/index.html View File

@ -230,5 +230,5 @@
</div>
</div>
</body>
<script src="./version.log.js"></script>
</html>

+ 1
- 0
public/version.log.js View File

@ -0,0 +1 @@
console.log('git:1e50e6e686135019ee9897fedc2efd099180b32c作者:liwei<wei.li@le-it.com.cn>日期:2021-6-11 10:40')

+ 3
- 5
version.js View File

@ -1,10 +1,9 @@
/**定义模块和变量**/
const exec = require('child_process').exec; //异步子进程
const execSync = require('child_process').execSync; //同步子进程
const fs = require('fs'); //文件读取模块
const versionPath = 'version.txt'; //version路径
const versionPath = 'version.log.js'; //version路径
const buildPath = 'dist'; //打包的路径
const autoPush = true; //写入版本信息之后是否自动提交git上
const autoPush = false; //写入版本信息之后是否自动提交git上
const commit = execSync('git show -s --format=%H').toString().trim(); //当前提交的版本号
/**程序开始**/
@ -22,8 +21,7 @@ if (versionStr.indexOf(commit) != -1) {
let name = execSync('git show -s --format=%cn').toString().trim(); //姓名
let email = execSync('git show -s --format=%ce').toString().trim(); //邮箱
let date = new Date(execSync('git show -s --format=%cd').toString()); //日期
let message = execSync('git show -s --format=%s').toString().trim(); //说明
versionStr = `git:${commit}\n作者:${name}<${email}>\n日期:${date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate()+' '+date.getHours()+':'+date.getMinutes()}\n说明:${message}\n${new Array(80).join('*')}\n${versionStr}`;
versionStr = `console.log('git:${commit};作者:${name}<${email}>;日期:${date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate()+' '+date.getHours()+':'+date.getMinutes()}')`;
fs.writeFileSync(versionPath, versionStr);
// 写入版本信息之后,自动将版本信息提交到当前分支的git上
if (autoPush) {


+ 1
- 0
version.log.js View File

@ -0,0 +1 @@
console.log('git:1e50e6e686135019ee9897fedc2efd099180b32c作者:liwei<wei.li@le-it.com.cn>日期:2021-6-11 10:40')

+ 0
- 12
version.txt View File

@ -1,12 +0,0 @@
git:83a905d2d714da8d465dba4090b4379fb5be9cc4
作者:liwei<wei.li@le-it.com.cn>
日期:2021-6-11 10:39
说明:Merge branch 'develop' of http://101.201.121.115:3000/leo/LAPP_GAAS_GFrame_WEBFRONT into liwei
*******************************************************************************
git:1a68481bc33098f2a7f571c0730cb462c6a02ca3
作者:Liwei<wei.li@le-it.com.cn>
日期:2021-6-7 9:53
说明:Merge pull request '修改甘特图样式' (#68) from feature_supplier into develop
*******************************************************************************

+ 2
- 1
vue.config.js View File

@ -42,7 +42,8 @@ module.exports = {
name: name,
resolve: {
alias: {
'@': resolve('src')
'@': resolve('src'),
version: resolve('static/js/version.log.js')
}
}
},


Loading…
Cancel
Save