增加指定npm脚本参数

This commit is contained in:
aixianling
2022-06-30 15:21:02 +08:00
parent 00cc2d9e4f
commit 6263a27aba
2 changed files with 3 additions and 3 deletions

View File

@@ -3,8 +3,8 @@ module.exports = {
action: "/node/wxmp/addOrUpdate",
method: "post",
execute: (request, response) => {
let {appid, privateKey, projectPath, version, miniapp_appid, id: pid} = request.body,
form = {appid, privateKey, projectPath, version, pid}, sql
let {appid, privateKey, projectPath, version, miniapp_appid, id: pid, npmScript} = request.body,
form = {appid, privateKey, projectPath, version, pid, npmScript}, sql
if (form.appid) {//编辑
let arr = Object.keys(form).filter(e => form[e]).map(e => `${e}='${form[e]}'`)
sql = `update node_wxmp_config set ${arr.join(",")} where appid='${form.appid}' and pid='${pid}'`

View File

@@ -19,7 +19,7 @@ module.exports = {
}, 2000))
const path = info.projectPath || '/home/deploy/node-service/dvcp_v2_wechat',
dest = `/home/deploy/wxmpZips/${uid}/`
execute(`cd ${path}&&npm run apps&&node bin/pages.js ${appid} ${id}&&npm run build`)
execute(`cd ${path}&&npm run apps&&node bin/pages.js ${appid} ${id}&&npm run ${info.npmScript || 'build'}`)
.then(() => fse.emptyDir(dest))
.then(() => fse.copy(`${path}/dist/build/mp-weixin/`, dest))
.then(() => fse.emptyDir(`${path}/dist/build`))