@oxiaom/adoremix 1.0.25 → 1.0.27
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 +1 -1
- package/src/doctor.js +33 -3
- package/src/install.js +7 -0
package/package.json
CHANGED
package/src/doctor.js
CHANGED
|
@@ -153,6 +153,13 @@ function runDoctor(workdir, opts) {
|
|
|
153
153
|
logger.ok(`✓ Node.js v${nodeVer}`);
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
+
// 1.5 安装目录不能含中文等非 ASCII 字符(AdoreMix 在含中文路径下运行会出问题)
|
|
157
|
+
if (/[^\x00-\x7F]/.test(workdir)) {
|
|
158
|
+
issues.push({ type: 'workdir-nonascii', severity: 'error', msg: `安装目录含非 ASCII 字符(中文等):${workdir}。AdoreMix 在含中文的路径下运行会出问题,请改用纯英文路径重装(Windows 例 C:\\adoremix,Linux 例 /opt/adoremix)。` });
|
|
159
|
+
logger.error(`❌ 安装目录含非 ASCII 字符(中文等):${workdir}`);
|
|
160
|
+
logger.log(` 请用纯英文路径重新安装:adoremix install --workdir <纯英文路径> --force`);
|
|
161
|
+
}
|
|
162
|
+
|
|
156
163
|
// 2. native 包是否加载
|
|
157
164
|
let native;
|
|
158
165
|
try {
|
|
@@ -200,12 +207,14 @@ function runDoctor(workdir, opts) {
|
|
|
200
207
|
logger.ok(`✓ 动态库依赖完整`);
|
|
201
208
|
} else {
|
|
202
209
|
logger.error(`❌ 缺动态库:${missing.join(', ')}`);
|
|
203
|
-
// 分类:apt 可装 / ICU 70
|
|
210
|
+
// 分类:apt 可装 / ICU(分已知 70 / 其他版本) / 完全未知
|
|
204
211
|
const pkgs = [];
|
|
205
212
|
const icu70 = [];
|
|
213
|
+
const icuOther = [];
|
|
206
214
|
const unknown = [];
|
|
207
215
|
for (const lib of missing) {
|
|
208
216
|
if (ICU70_LIBS.includes(lib)) icu70.push(lib);
|
|
217
|
+
else if (lib.startsWith('libicu')) icuOther.push(lib);
|
|
209
218
|
else if (LIB_TO_PKG[lib]) pkgs.push(LIB_TO_PKG[lib]);
|
|
210
219
|
else unknown.push(lib);
|
|
211
220
|
}
|
|
@@ -229,10 +238,10 @@ function runDoctor(workdir, opts) {
|
|
|
229
238
|
}
|
|
230
239
|
}
|
|
231
240
|
|
|
232
|
-
// 2) ICU 70
|
|
241
|
+
// 2) ICU 70 跨发行版兜底(旧包,Debian 12 / 树莓派 OS / Armbian 等无 libicu70)
|
|
233
242
|
let icuSolved = icu70.length === 0;
|
|
234
243
|
if (icu70.length > 0) {
|
|
235
|
-
const icuMsg = `ICU 70 缺失(${icu70.join(', ')})—
|
|
244
|
+
const icuMsg = `ICU 70 缺失(${icu70.join(', ')})— 旧包在 Ubuntu 22.04 编译需 libicu70。建议先升级到最新版(v1.0.27+ 已把 ICU 捆绑进 lib/),或 doctor --fix 自动装 libicu70`;
|
|
236
245
|
if (opts.fix) {
|
|
237
246
|
if (tryFixIcu70()) {
|
|
238
247
|
logger.ok('✓ libicu70 已安装(ICU 70 兜底)');
|
|
@@ -247,6 +256,13 @@ function runDoctor(workdir, opts) {
|
|
|
247
256
|
}
|
|
248
257
|
}
|
|
249
258
|
|
|
259
|
+
// 2.5) 其他版本 ICU 缺失(v1.0.27+ 已捆绑 ICU,正常不应缺;缺了说明安装目录 lib/ 不完整)
|
|
260
|
+
if (icuOther.length > 0) {
|
|
261
|
+
const icuOtherMsg = `ICU 缺失(${icuOther.join(', ')})。v1.0.27+ 已把 ICU 捆绑进 lib/,出现此错误说明安装目录 lib/ 不完整,请重新 adoremix install --force 刷新;或系统缺对应版本 libicu。`;
|
|
262
|
+
issues.push({ type: 'icu-other', severity: 'error', msg: icuOtherMsg });
|
|
263
|
+
logger.error(`❌ ${icuOtherMsg}`);
|
|
264
|
+
}
|
|
265
|
+
|
|
250
266
|
// 3) 未解决的记 issue
|
|
251
267
|
if (!aptSolved) {
|
|
252
268
|
issues.push({
|
|
@@ -332,6 +348,20 @@ function runDoctor(workdir, opts) {
|
|
|
332
348
|
logger.warn(`⚠ config.ini 不存在`);
|
|
333
349
|
}
|
|
334
350
|
|
|
351
|
+
// 5.5 工作目录是否由旧版本安装(native 有更新时需 install --force 刷新,否则继续用旧二进制)
|
|
352
|
+
const markerPath = path.join(workdir, '.adoremix-installed');
|
|
353
|
+
try {
|
|
354
|
+
const marker = JSON.parse(fs.readFileSync(markerPath, 'utf8'));
|
|
355
|
+
const pkgVer = require('../package.json').version;
|
|
356
|
+
if (marker.version && marker.version !== pkgVer) {
|
|
357
|
+
issues.push({ type: 'workdir-stale', severity: 'warn', msg: `工作目录由 v${marker.version} 安装,当前包 v${pkgVer}。若 native 有更新需 adoremix install --force 刷新二进制/资源(保留 config.ini)。` });
|
|
358
|
+
logger.warn(`⚠ 工作目录由 v${marker.version} 安装,当前包 v${pkgVer},二进制/资源可能陈旧`);
|
|
359
|
+
logger.log(` 刷新:adoremix install --force`);
|
|
360
|
+
} else if (marker.version) {
|
|
361
|
+
logger.ok(`✓ 工作目录版本 v${marker.version} 与当前包一致`);
|
|
362
|
+
}
|
|
363
|
+
} catch (e) { /* .adoremix-installed 不存在或不可解析则跳过 */ }
|
|
364
|
+
|
|
335
365
|
// 6. .Adore.db 存在 + 有数据
|
|
336
366
|
const dbPath = path.join(workdir, '.Adore.db');
|
|
337
367
|
if (fs.existsSync(dbPath)) {
|
package/src/install.js
CHANGED
|
@@ -159,6 +159,13 @@ function deployWebuiIfPresent(workdir) {
|
|
|
159
159
|
async function runInstall(opts) {
|
|
160
160
|
opts = opts || {};
|
|
161
161
|
const workdir = opts.workdir || paths.defaultWorkdir();
|
|
162
|
+
// 前置拦截:安装目录不能含中文等非 ASCII 字符(AdoreMix 在含中文路径下运行会出问题)
|
|
163
|
+
if (/[^\x00-\x7F]/.test(workdir)) {
|
|
164
|
+
logger.error(`❌ 工作目录含非 ASCII 字符(中文等):${workdir}`);
|
|
165
|
+
logger.log(` AdoreMix 在含中文的路径下运行会出问题,请用纯英文路径重装,如:`);
|
|
166
|
+
logger.log(` adoremix install --workdir C:/adoremix`);
|
|
167
|
+
return 1;
|
|
168
|
+
}
|
|
162
169
|
let native;
|
|
163
170
|
try {
|
|
164
171
|
native = opts.native || paths.loadNative();
|