增加指定npm脚本参数

This commit is contained in:
aixianling
2022-06-30 16:00:50 +08:00
parent 5e16f0ca9f
commit 211ab357e4

View File

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