Browse Source

删除最外层version.log.js文件

pull/79/head
liwei 3 years ago
parent
commit
757424dcc7
3 changed files with 3 additions and 2 deletions
  1. +1
    -0
      public/version.log.js
  2. +2
    -2
      version.js
  3. +0
    -0
      version.log.js

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

@ -0,0 +1 @@
const version='git:ddccd3065d4b6cd57d024588e7c92fe086c0f85d;作者:liwei<wei.li@le-it.com.cn>;日期:2021-6-11 17:18';console.log(version);

+ 2
- 2
version.js View File

@ -1,7 +1,7 @@
/** 定义模块和变量**/ /** 定义模块和变量**/
const execSync = require('child_process').execSync // 同步子进程 const execSync = require('child_process').execSync // 同步子进程
const fs = require('fs') // 文件读取模块 const fs = require('fs') // 文件读取模块
const versionPath = 'version.log.js' // version路径
const versionPath = 'public/version.log.js' // version路径
const buildPath = 'dist' // 打包的路径 const buildPath = 'dist' // 打包的路径
const autoPush = false // 写入版本信息之后是否自动提交git上 const autoPush = false // 写入版本信息之后是否自动提交git上
const commit = execSync('git show -s --format=%H').toString().trim() // 当前提交的版本号 const commit = execSync('git show -s --format=%H').toString().trim() // 当前提交的版本号
@ -32,7 +32,7 @@ if (autoPush) {
// 将version文件移植到打包文件中 // 将version文件移植到打包文件中
if (fs.existsSync(buildPath)) { if (fs.existsSync(buildPath)) {
fs.writeFileSync(`${buildPath}/${versionPath}`, fs.readFileSync(versionPath))
fs.writeFileSync(`${buildPath}/version.log.js`, fs.readFileSync(versionPath))
} }
// 程序执行结束 // 程序执行结束


+ 0
- 0
version.log.js View File


Loading…
Cancel
Save