增加指定npm脚本参数

This commit is contained in:
aixianling
2022-06-30 15:53:10 +08:00
parent 6263a27aba
commit 5e16f0ca9f

View File

@@ -18,10 +18,10 @@ module.exports = {
response.send({code: 0})
}, 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 ${info.npmScript || 'build'}`)
dest = `/home/deploy/wxmpZips/${uid}/`, processEnv = info.npmScript || 'build'
execute(`cd ${path}&&npm run apps&&node bin/pages.js ${appid} ${id}&&npm run ${processEnv}`)
.then(() => fse.emptyDir(dest))
.then(() => fse.copy(`${path}/dist/build/mp-weixin/`, dest))
.then(() => fse.copy(`${path}/dist/${processEnv}/mp-weixin/`, dest))
.then(() => fse.emptyDir(`${path}/dist/build`))
.then(() => {
db.query(`update node_wxmp_config set error='打包时间:${dayjs().format("YYYY-MM-DD HH:mm:ss")}' where ${uniCon}`)