Comparing version 1.1.33 to 1.1.35
{ | ||
"name": "@3m/cli", | ||
"version": "1.1.33", | ||
"version": "1.1.35", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "repository": "git@code.aliyun.com:3m/repos-tools.git", |
@@ -60,3 +60,3 @@ #!/usr/bin/env node | ||
async function updateAllVersions(newVersion) { | ||
function _updateFileVersion(moduleJson, filePath) { | ||
function _updateFileVersion(modName, filePath) { | ||
// 检测是否存在 | ||
@@ -68,4 +68,4 @@ if (!fs.existsSync(filePath)) { | ||
json.version = newVersion; | ||
json.releaseAt = new Date().toUTCString(); | ||
json.module = moduleJson.name; | ||
json.releaseAt = new Date(); | ||
json.module = modName; | ||
@@ -75,14 +75,14 @@ fs.writeJsonSync(filePath, json, { spaces: 2 }); | ||
} | ||
_updateFileVersion('./module.json'); | ||
const moduleJson = fs.readJsonSync('./module.json'); | ||
const mod = fs.readJsonSync('./module.json'); | ||
_updateFileVersion(mod.name, './module.json'); | ||
// 更新html版本信息 | ||
if (moduleJson.packages.html) { | ||
for (const pkg of moduleJson.packages.html) { | ||
_updateFileVersion(moduleJson, path.join('.', pkg, 'package.json')); | ||
if (mod.packages.html) { | ||
for (const pkg of mod.packages.html) { | ||
_updateFileVersion(mod.name, path.join('.', pkg, 'package.json')); | ||
} | ||
} | ||
// 更新service版本信息 | ||
_updateFileVersion(moduleJson, path.join('./service/', 'package.json')); | ||
_updateFileVersion(mod.name, path.join('./service/', 'package.json')); | ||
// 更新api版本信息 | ||
_updateFileVersion(moduleJson, path.join('./api/', 'package.json')); | ||
_updateFileVersion(mod.name, path.join('./api/', 'package.json')); | ||
} | ||
@@ -89,0 +89,0 @@ |
35747