diff --git a/src/rest/autodeploy/download.js b/src/rest/autodeploy/download.js index 1efb0a9..b1b18df 100644 --- a/src/rest/autodeploy/download.js +++ b/src/rest/autodeploy/download.js @@ -9,13 +9,13 @@ module.exports = { dbUtils.query(sql).then(res => { let info = res?.[0] if (info?.id) { - let path = `${info.target}`, zipPath = `/home/deploy/node-service/zips/${info.id}.zip` + let path = `${info.target}`, zipPath = `/zips/${info.id}.zip` fse.removeSync(zipPath) fse.pathExists(path, (err, exists) => { console.log(`${path}=========>${exists}`) if (exists) { execute(`cd ${path}&&zip -r ${info.id}.zip .`) - .then(() => execute(`cd ${path}&&mv ${info.id}.zip /home/deploy/node-service/zips`)) + .then(() => execute(`cd ${path}&&mv ${info.id}.zip /zips`)) .then(() => { console.log('压缩完成!') setTimeout(() => { diff --git a/src/rest/custom/download.js b/src/rest/custom/download.js index 2a0b973..299b9d0 100644 --- a/src/rest/custom/download.js +++ b/src/rest/custom/download.js @@ -8,13 +8,13 @@ module.exports = { let id = request.query?.id dbUtils.detail({table: 'node_custom_config', id}).then(info => { if (info?.id) { - let path = `${info.dist || `../zips/${info.name}v${info.version}`}`, zipPath = `../zips/${info.id}.zip` + let path = `${info.dist || `/zips/${info.name}v${info.version}`}`, zipPath = `/zips/${info.id}.zip` fse.removeSync(zipPath) fse.pathExists(path, (err, exists) => { console.log(`${path}=========>${exists}`) if (exists) { execute(`cd ${path}&&zip -r ${info.id}.zip .`) - .then(() => execute(`cd ${path}&&mv ${info.id}.zip /home/deploy/node_deploy/zips/`)) + .then(() => execute(`cd ${path}&&mv ${info.id}.zip /zips/`)) .then(() => { console.log('压缩完成!') setTimeout(() => { diff --git a/src/rest/wechat/download.js b/src/rest/wechat/download.js index 452a34d..034972d 100644 --- a/src/rest/wechat/download.js +++ b/src/rest/wechat/download.js @@ -6,13 +6,13 @@ module.exports = { execute: (request, response) => { let {id} = request.query if (id) { - let path = `/home/deploy/node_deploy/zips/${id}/`, zipPath = `/home/deploy/node_deploy/zips/${id}.zip` + let path = `/zips/${id}/`, zipPath = `/zips/${id}.zip` fse.removeSync(zipPath) fse.pathExists(path, (err, exists) => { console.log(`${path}=========>${exists}`) if (exists) { execute(`cd ${path}&&zip -r ${id}.zip .`) - .then(() => execute(`cd ${path}&&mv ${id}.zip /home/deploy/node_deploy/zips`)) + .then(() => execute(`cd ${path}&&mv ${id}.zip /zips`)) .then(() => { console.log('压缩完成!') setTimeout(() => { diff --git a/src/rest/wechat/getZip.js b/src/rest/wechat/getZip.js index 74df7b4..5d610de 100644 --- a/src/rest/wechat/getZip.js +++ b/src/rest/wechat/getZip.js @@ -16,8 +16,8 @@ module.exports = { db.query(sql).then(() => setTimeout(() => { response.send({code: 0}) }, 2000)) - const path = info.projectPath || (isDev ? 'E:\\code\\cunwei\\dvcp_v2_wechat' : '/home/deploy/node_deploy/dvcp_v2_wechat'), - dest = (isDev ? `E:\\wxmpZips\\${id}` : `/home/deploy/node_deploy/zips/${id}/`), + const path = info.projectPath || (isDev ? 'E:\\code\\cunwei\\dvcp_v2_wechat' : '/dvcp_v2_wechat'), + dest = (isDev ? `E:\\wxmpZips\\${id}` : `/zips/${id}/`), 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}`)