From bc79fa48befd3a9ec87a51ce6bfe7a7a6810128c Mon Sep 17 00:00:00 2001 From: aixianling Date: Fri, 10 Jun 2022 12:00:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=89=93=E5=8C=85=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rest/autodeploy/download.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rest/autodeploy/download.js b/src/rest/autodeploy/download.js index e83f177..752c371 100644 --- a/src/rest/autodeploy/download.js +++ b/src/rest/autodeploy/download.js @@ -9,12 +9,12 @@ module.exports = { dbUtils.query(sql).then(res => { let info = res?.[0] if (info?.id) { - let path = `${info.target}`, zipPath = `./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(`zip -r ${zipPath} ${path}`).then(() => { + execute(`cd ../zips`).then(() => execute(`zip -r ${info.id}.zip ${path}`)).then(() => { console.log('压缩完成!') setTimeout(() => { response.download(zipPath)