增加指定npm脚本参数
This commit is contained in:
@@ -3,8 +3,8 @@ module.exports = {
|
|||||||
action: "/node/wxmp/addOrUpdate",
|
action: "/node/wxmp/addOrUpdate",
|
||||||
method: "post",
|
method: "post",
|
||||||
execute: (request, response) => {
|
execute: (request, response) => {
|
||||||
let {appid, privateKey, projectPath, version, miniapp_appid, id: pid} = request.body,
|
let {appid, privateKey, projectPath, version, miniapp_appid, id: pid, npmScript} = request.body,
|
||||||
form = {appid, privateKey, projectPath, version, pid}, sql
|
form = {appid, privateKey, projectPath, version, pid, npmScript}, sql
|
||||||
if (form.appid) {//编辑
|
if (form.appid) {//编辑
|
||||||
let arr = Object.keys(form).filter(e => form[e]).map(e => `${e}='${form[e]}'`)
|
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}'`
|
sql = `update node_wxmp_config set ${arr.join(",")} where appid='${form.appid}' and pid='${pid}'`
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ module.exports = {
|
|||||||
}, 2000))
|
}, 2000))
|
||||||
const path = info.projectPath || '/home/deploy/node-service/dvcp_v2_wechat',
|
const path = info.projectPath || '/home/deploy/node-service/dvcp_v2_wechat',
|
||||||
dest = `/home/deploy/wxmpZips/${uid}/`
|
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.emptyDir(dest))
|
||||||
.then(() => fse.copy(`${path}/dist/build/mp-weixin/`, dest))
|
.then(() => fse.copy(`${path}/dist/build/mp-weixin/`, dest))
|
||||||
.then(() => fse.emptyDir(`${path}/dist/build`))
|
.then(() => fse.emptyDir(`${path}/dist/build`))
|
||||||
|
|||||||
Reference in New Issue
Block a user