@winner-fed/winner-deploy 2.0.10 → 2.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  ## python 版本脚本兼容性问题
4
4
  python2 对应 template/1.x
5
5
 
6
+ ## 功能接口说明
6
7
  ```javscript
7
8
  /**
8
9
  * 生成 see 平台部署包
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@winner-fed/winner-deploy",
3
- "version": "2.0.10",
3
+ "version": "2.0.11",
4
4
  "description": "Generate a publication deployed by the See platform",
5
5
  "keywords": [
6
6
  "winner",
@@ -139,12 +139,15 @@ exports.generateSeePackageZip = function generateSeePackageZip ({
139
139
  // 不包含在 manifest.json 配置的文件,直接拷贝到 see 包里
140
140
  if (Array.isArray(copyFiles) && copyFiles.length) {
141
141
  copyFiles.forEach((file) => {
142
- fs.copyFileSync(`./dist/${name}/${file}`, `./tmp/source/${name}/${file}`);
142
+ // 1. 首先先确保文件目录存在,否则创建
143
+ fs.ensureFileSync(`./tmp/source/${name}/${file}`)
144
+ // 2. 然后进行拷贝
145
+ fs.copyFileSync(`./dist/${name}/${file}`, `./tmp/source/${name}/${file}`)
143
146
  });
144
147
  }
145
148
 
146
149
  // 自定义执行的操作
147
- typeof cb === 'function' && cb();
150
+ typeof cb === 'function' && cb()
148
151
 
149
152
  done()
150
153
  console.log()