From 143f9c7dde41baf1437a472ebcbe4142c08972dd Mon Sep 17 00:00:00 2001 From: liwei Date: Fri, 11 Jun 2021 13:43:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E7=95=8C=E9=9D=A2=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E7=89=88=E6=9C=AC=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html | 2 +- public/version.log.js | 1 + version.js | 8 +++----- version.log.js | 1 + version.txt | 12 ------------ vue.config.js | 3 ++- 6 files changed, 8 insertions(+), 19 deletions(-) create mode 100644 public/version.log.js create mode 100644 version.log.js delete mode 100644 version.txt diff --git a/public/index.html b/public/index.html index be94e6b..0a3a63d 100644 --- a/public/index.html +++ b/public/index.html @@ -230,5 +230,5 @@ - + \ No newline at end of file diff --git a/public/version.log.js b/public/version.log.js new file mode 100644 index 0000000..c76a647 --- /dev/null +++ b/public/version.log.js @@ -0,0 +1 @@ +console.log('git:1e50e6e686135019ee9897fedc2efd099180b32c作者:liwei日期:2021-6-11 10:40') \ No newline at end of file diff --git a/version.js b/version.js index 81fce32..c100040 100644 --- a/version.js +++ b/version.js @@ -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) { diff --git a/version.log.js b/version.log.js new file mode 100644 index 0000000..c76a647 --- /dev/null +++ b/version.log.js @@ -0,0 +1 @@ +console.log('git:1e50e6e686135019ee9897fedc2efd099180b32c作者:liwei日期:2021-6-11 10:40') \ No newline at end of file diff --git a/version.txt b/version.txt deleted file mode 100644 index fe1d922..0000000 --- a/version.txt +++ /dev/null @@ -1,12 +0,0 @@ -git:83a905d2d714da8d465dba4090b4379fb5be9cc4 -作者:liwei -日期: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 -日期:2021-6-7 9:53 -说明:Merge pull request '修改甘特图样式' (#68) from feature_supplier into develop -******************************************************************************* - - diff --git a/vue.config.js b/vue.config.js index a932413..cd42a8f 100644 --- a/vue.config.js +++ b/vue.config.js @@ -42,7 +42,8 @@ module.exports = { name: name, resolve: { alias: { - '@': resolve('src') + '@': resolve('src'), + version: resolve('static/js/version.log.js') } } },