root=>/home/deploy
This commit is contained in:
@@ -9,13 +9,13 @@ module.exports = {
|
|||||||
dbUtils.query(sql).then(res => {
|
dbUtils.query(sql).then(res => {
|
||||||
let info = res?.[0]
|
let info = res?.[0]
|
||||||
if (info?.id) {
|
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.removeSync(zipPath)
|
||||||
fse.pathExists(path, (err, exists) => {
|
fse.pathExists(path, (err, exists) => {
|
||||||
console.log(`${path}=========>${exists}`)
|
console.log(`${path}=========>${exists}`)
|
||||||
if (exists) {
|
if (exists) {
|
||||||
execute(`cd ${path}&&zip -r ${info.id}.zip .`)
|
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(() => {
|
.then(() => {
|
||||||
console.log('压缩完成!')
|
console.log('压缩完成!')
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user