+1
-1
@@ -17,3 +17,3 @@ const path = require('path') | ||
| clearDistZip(config) | ||
| await clearDistZip(config) | ||
@@ -20,0 +20,0 @@ process.exit() // 退出流程 |
+1
-1
| { | ||
| "name": "c-deploy", | ||
| "version": "2.0.0", | ||
| "version": "2.0.1", | ||
| "description": "node执行自动部署,可配置多环境,自动打包并部署到服务器上", | ||
@@ -5,0 +5,0 @@ "bin": { |
+9
-2
@@ -19,4 +19,11 @@ const fs = require('fs') | ||
| const clearDistZip = (config) => { | ||
| const distZipPath = path.resolve(process.cwd(), `${config.publicPath}.zip`) | ||
| fs.unlink(distZipPath, () => {}) | ||
| return new Promise((resolve, reject) => { | ||
| const distZipPath = path.resolve(process.cwd(), `${config.publicPath}.zip`) | ||
| fs.unlink(distZipPath, (err) => { | ||
| if (err) { | ||
| reject('本地zip文件删除失败...') | ||
| } | ||
| resolve() | ||
| }) | ||
| }) | ||
| } | ||
@@ -23,0 +30,0 @@ |
14986
1.11%257
2.8%