ee-bin 1.8.2 → 1.8.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ee-bin",
3
- "version": "1.8.2",
3
+ "version": "1.8.3",
4
4
  "description": "ee bin",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -2,10 +2,11 @@
2
2
 
3
3
  const path = require('path');
4
4
  const fs = require('fs');
5
- const crypto = require('crypto')
5
+ const crypto = require('crypto');
6
6
  const chalk = require('chalk');
7
7
  const Utils = require('../lib/utils');
8
- const admZip = require('adm-zip')
8
+ const admZip = require('adm-zip');
9
+ const globby = require('globby');
9
10
 
10
11
  /**
11
12
  * 增量升级
@@ -86,11 +87,16 @@ module.exports = {
86
87
  zip.addLocalFile(asarFilePath);
87
88
  // 添加 extraResources
88
89
  if (cfg.extraResources && cfg.extraResources.length > 0) {
89
- for (const extraRes of cfg.extraResources) {
90
+ const files = globby.sync(cfg.extraResources, { cwd: homeDir });
91
+ for (const extraRes of files) {
90
92
  const extraResPath = path.normalize(path.join(homeDir, extraRes));
91
- if (fs.existsSync(extraResPath)) {
92
- zip.addLocalFile(extraResPath, "extraResources");
93
+ if (!fs.existsSync(extraResPath)) {
94
+ continue;
93
95
  }
96
+ const extraResDir = path.dirname(extraResPath);
97
+ const index = extraResDir.indexOf('extraResources');
98
+ const zipFileDir = extraResDir.substring(index);
99
+ zip.addLocalFile(extraResPath, zipFileDir);
94
100
  }
95
101
  }
96
102