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)