root=>/home/deploy

This commit is contained in:
aixianling
2022-06-17 17:46:30 +08:00
parent bc76415d6f
commit 11e1a726ae

View File

@@ -9,13 +9,13 @@ 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 = `/home/deploy/node-service/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 /root/node-service/zips`))
.then(() => execute(`cd ${path}&&mv ${info.id}.zip /home/deploy/node-service/zips`))
.then(() => {
console.log('压缩完成!')
setTimeout(() => {