From 757424dcc793b6756a4f5719a0f9af214b00ffba Mon Sep 17 00:00:00 2001 From: liwei Date: Fri, 11 Jun 2021 17:34:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=9C=80=E5=A4=96=E5=B1=82ve?= =?UTF-8?q?rsion.log.js=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/version.log.js | 1 + version.js | 4 ++-- version.log.js | 0 3 files changed, 3 insertions(+), 2 deletions(-) delete mode 100644 version.log.js diff --git a/public/version.log.js b/public/version.log.js index e69de29..95be882 100644 --- a/public/version.log.js +++ b/public/version.log.js @@ -0,0 +1 @@ +const version='git:ddccd3065d4b6cd57d024588e7c92fe086c0f85d;作者:liwei;日期:2021-6-11 17:18';console.log(version); \ No newline at end of file diff --git a/version.js b/version.js index 0a8dace..5ccf044 100644 --- a/version.js +++ b/version.js @@ -1,7 +1,7 @@ /** 定义模块和变量**/ const execSync = require('child_process').execSync // 同步子进程 const fs = require('fs') // 文件读取模块 -const versionPath = 'version.log.js' // version路径 +const versionPath = 'public/version.log.js' // version路径 const buildPath = 'dist' // 打包的路径 const autoPush = false // 写入版本信息之后是否自动提交git上 const commit = execSync('git show -s --format=%H').toString().trim() // 当前提交的版本号 @@ -32,7 +32,7 @@ if (autoPush) { // 将version文件移植到打包文件中 if (fs.existsSync(buildPath)) { - fs.writeFileSync(`${buildPath}/${versionPath}`, fs.readFileSync(versionPath)) + fs.writeFileSync(`${buildPath}/version.log.js`, fs.readFileSync(versionPath)) } // 程序执行结束 diff --git a/version.log.js b/version.log.js deleted file mode 100644 index e69de29..0000000