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