迁移打包路径到/home/deploy

This commit is contained in:
aixianling
2022-06-17 14:24:47 +08:00
parent 087d34071f
commit 00e1fc04de

View File

@@ -17,10 +17,12 @@ module.exports = {
db.query(sql).then(() => setTimeout(() => {
response.send({code: 0})
}, 2000))
execute(`cd ${info.projectPath || '/root/node-service/dvcp_v2_wechat'}&&npm run apps&&node bin/pages.js ${id}&&npm run build`)
.then(() => fse.emptyDir(`../wxmpZips/${id}/`))
.then(() => fse.copy(`${info.projectPath || '/root/node-service/dvcp_v2_wechat'}/dist/build/mp-weixin/`, `../wxmpZips/${id}/`))
.then(() => fse.emptyDir(`${info.projectPath || '/root/node-service/dvcp_v2_wechat'}/dist/build`))
const path = info.projectPath || '/home/deploy/node-service/dvcp_v2_wechat',
dest = `/home/deploy/wxmpZips/${id}/`
execute(`cd ${path}&&npm run apps&&node bin/pages.js ${id}&&npm run build`)
.then(() => fse.emptyDir(dest))
.then(() => fse.copy(`${path}/dist/build/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 appid='${info.appid}'`)
}).catch(err => {