mirror of
https://github.com/wallace5303/ee-core.git
synced 2026-04-05 15:39:03 +08:00
[feat] [ee-bin] fix updater
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ee-bin",
|
||||
"version": "4.1.3",
|
||||
"version": "4.1.4",
|
||||
"description": "ee bin",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -3,10 +3,12 @@
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const fsPro = require('fs-extra');
|
||||
const crypto = require('crypto')
|
||||
const crypto = require('crypto');
|
||||
const chalk = require('chalk');
|
||||
const { loadConfig, getPackage, writeJsonSync } = require('../lib/utils');
|
||||
const admZip = require('adm-zip')
|
||||
const admZip = require('adm-zip');
|
||||
const globby = require('globby');
|
||||
|
||||
|
||||
/**
|
||||
* 增量升级
|
||||
@@ -90,11 +92,16 @@ class IncrUpdater {
|
||||
zip.addLocalFile(asarFilePath);
|
||||
// 添加 extraResources
|
||||
if (cfg.extraResources && cfg.extraResources.length > 0) {
|
||||
for (const extraRes of cfg.extraResources) {
|
||||
const files = globby.sync(cfg.extraResources, { cwd: homeDir });
|
||||
for (const extraRes of files) {
|
||||
const extraResPath = path.normalize(path.join(homeDir, extraRes));
|
||||
if (fs.existsSync(extraResPath)) {
|
||||
zip.addLocalFile(extraResPath, "extraResources");
|
||||
if (!fs.existsSync(extraResPath)) {
|
||||
continue;
|
||||
}
|
||||
const extraResDir = path.dirname(extraResPath);
|
||||
const index = extraResDir.indexOf('extraResources');
|
||||
const zipFileDir = extraResDir.substring(index);
|
||||
zip.addLocalFile(extraResPath, zipFileDir);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user