@walkhi/code-relax 0.1.0-beta.104 → 0.1.0-beta.105

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.
@@ -274,7 +274,14 @@ async function main() {
274
274
  const desktopNeedsRestart = !hadInstalledService && desktopBeforeSetup.running && !preserveCodex;
275
275
  const previous = hadInstalledService ? await service.status() : { processRunning: false };
276
276
  const legacyRelaySession = readRecord(path.join(stateRoot, 'self-relay-session.json'));
277
- const previousRelay = legacyRelaySession ? await controlRequest(legacyRelaySession) : await selfRelay('relay-status', stateRoot);
277
+ let previousRelay;
278
+ try {
279
+ previousRelay = legacyRelaySession ? await controlRequest(legacyRelaySession) : await selfRelay('relay-status', stateRoot);
280
+ } catch (error) {
281
+ if (error.code !== 'ECONNREFUSED') throw error;
282
+ // A saved session can outlive its listener after an interrupted installation.
283
+ previousRelay = { running: false };
284
+ }
278
285
  const resumeAfterUpdate = previous.processRunning || previousRelay.running;
279
286
  const executable = currentNodeExecutable();
280
287
  const startInstalled = async () => {
@@ -284,7 +291,7 @@ async function main() {
284
291
  child.stderr.on('data', chunk => { errors += chunk; });
285
292
  const code = await new Promise((resolve, reject) => { child.once('error', reject); child.once('exit', resolve); });
286
293
  try {
287
- if (code !== 0) throw new Error(errors.trim().replace(/^(?:Code Relax:)+/u, '') || '桌面服务启动失败');
294
+ if (code !== 0) throw new Error(`启动固定目录的工作站服务失败:${errors.trim().replace(/^(?:Code Relax:)+/u, '') || `退出码 ${code}`}`);
288
295
  if (previousRelay.deviceId) {
289
296
  const restoredRelay = await selfRelay('relay-status', stateRoot);
290
297
  if (restoredRelay.deviceId !== previousRelay.deviceId ||
@@ -1 +1 @@
1
- {"layout":"npm-platform-packages","version":"0.1.0-beta.104"}
1
+ {"layout":"npm-platform-packages","version":"0.1.0-beta.105"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@walkhi/code-relax",
3
- "version": "0.1.0-beta.104",
3
+ "version": "0.1.0-beta.105",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",