@taole/deploy-helper 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/lightDeploy.mjs +1 -1
- package/lib/project.mjs +24 -1
- package/package.json +1 -1
package/lib/lightDeploy.mjs
CHANGED
package/lib/project.mjs
CHANGED
|
@@ -252,6 +252,29 @@ export const cmdProjectCreate = async () => {
|
|
|
252
252
|
JSON.stringify(targetPackageJson, null, 2)
|
|
253
253
|
);
|
|
254
254
|
log(`项目package.json覆盖成功`);
|
|
255
|
+
const readmePath = path.join(projectDir, "README.md");
|
|
256
|
+
if (fs.existsSync(readmePath)) {
|
|
257
|
+
const readmeContent = fs.readFileSync(readmePath, "utf8");
|
|
258
|
+
if (!readmeContent.includes("## 访问")) {
|
|
259
|
+
const accessLines = [
|
|
260
|
+
"",
|
|
261
|
+
"## 访问",
|
|
262
|
+
`测试环境地址\thttps://act-test.tuwan.com/${name}/index.html`,
|
|
263
|
+
`线上环境地址\thttps://act.tuwan.com/${name}/index.html`,
|
|
264
|
+
`仓库地址\thttps://codeup.aliyun.com/69b3821af7b43e00d420cb32/Web-Act/${name}`,
|
|
265
|
+
];
|
|
266
|
+
if (createResult.id != null) {
|
|
267
|
+
accessLines.push(
|
|
268
|
+
`后台地址\thttps://act.tuwan.com/fe-admin/index.html#/h5/h5projects/h5projects-show?id=${createResult.id}`
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
fs.writeFileSync(
|
|
272
|
+
readmePath,
|
|
273
|
+
readmeContent.trimEnd() + "\n" + accessLines.join("\n") + "\n"
|
|
274
|
+
);
|
|
275
|
+
log(`README.md 追加访问信息成功`);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
255
278
|
await git.add(".");
|
|
256
279
|
await git.commit(`-#DH-07 feat: 项目初始化`);
|
|
257
280
|
log(`请cd至项目目录: ${projectDir} 手动执行: npm install 安装依赖`);
|
|
@@ -377,7 +400,7 @@ export const cmdProjectPull = async () => {
|
|
|
377
400
|
log(`项目拉取成功, 项目目录: ${name}`);
|
|
378
401
|
git = simpleGit(projectDir);
|
|
379
402
|
const targetPackageJson = getJsonConfig(projectDir, "package.json");
|
|
380
|
-
if(targetPackageJson.name !== name){
|
|
403
|
+
if (targetPackageJson.name !== name) {
|
|
381
404
|
targetPackageJson.name = name;
|
|
382
405
|
fs.writeFileSync(
|
|
383
406
|
path.join(projectDir, "package.json"),
|