@aiyiran/myclaw 1.0.20 → 1.0.22
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/wsl2.js +17 -8
package/package.json
CHANGED
package/wsl2.js
CHANGED
|
@@ -326,13 +326,10 @@ ${askTar}
|
|
|
326
326
|
|
|
327
327
|
Write-Host ' 正在导入 (可能需要几分钟)...'
|
|
328
328
|
|
|
329
|
-
#
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
wsl --unregister $distroName 2>$null
|
|
334
|
-
Write-Host ' [OK] 旧版已卸载'
|
|
335
|
-
}
|
|
329
|
+
# 先尝试卸载旧的同名发行版(不存在则忽略)
|
|
330
|
+
Write-Host ' 清理旧版本...'
|
|
331
|
+
try { wsl --unregister $distroName 2>$null } catch {}
|
|
332
|
+
Write-Host ' [OK]'
|
|
336
333
|
|
|
337
334
|
try {
|
|
338
335
|
New-Item -ItemType Directory -Force -Path $installDir | Out-Null
|
|
@@ -405,7 +402,9 @@ function run() {
|
|
|
405
402
|
console.log('[' + C.b + 'MyClaw' + C.nc + '] WSL2 一键安装向导');
|
|
406
403
|
console.log(bar);
|
|
407
404
|
|
|
408
|
-
|
|
405
|
+
const forceReinstall = process.argv.includes('--reinstall');
|
|
406
|
+
|
|
407
|
+
if (state === 'ready' && !forceReinstall) {
|
|
409
408
|
console.log('');
|
|
410
409
|
console.log('[' + C.g + 'OK' + C.nc + '] WSL2 已完全安装就绪!');
|
|
411
410
|
console.log('');
|
|
@@ -418,6 +417,16 @@ function run() {
|
|
|
418
417
|
console.log('');
|
|
419
418
|
console.log('输入 ' + C.y + 'wsl' + C.nc + ' 即可进入 Linux 环境。');
|
|
420
419
|
console.log('');
|
|
420
|
+
console.log('如需重新安装 Linux 环境,运行:');
|
|
421
|
+
console.log(' ' + C.y + 'myclaw wsl2 --reinstall' + C.nc);
|
|
422
|
+
console.log('');
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
if (state === 'ready' && forceReinstall) {
|
|
427
|
+
console.log('');
|
|
428
|
+
console.log('[' + C.y + '重装模式' + C.nc + '] 将重新导入 Linux 环境...');
|
|
429
|
+
runPhase2();
|
|
421
430
|
return;
|
|
422
431
|
}
|
|
423
432
|
|