@yoooclaw/cli 0.1.0 → 0.1.1

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/dist/index.cjs CHANGED
@@ -4271,7 +4271,7 @@ function buildContext(flags) {
4271
4271
  var import_node_fs3 = require("node:fs");
4272
4272
  function readBuildInjectedVersion() {
4273
4273
  if (false) {}
4274
- const version = "0.1.0".trim();
4274
+ const version = "0.1.1".trim();
4275
4275
  return version || undefined;
4276
4276
  }
4277
4277
  function readVersionFromPackageJson() {
@@ -14224,14 +14224,21 @@ async function daemonStop(ctx) {
14224
14224
  removeLock(ctx.paths);
14225
14225
  throw new YoooclawError("YOOOCLAW_DAEMON_NOT_RUNNING", "daemon 未运行");
14226
14226
  }
14227
- try {
14228
- process.kill(lock.pid, "SIGTERM");
14229
- } catch {}
14227
+ const graceful = process.platform === "win32" ? "stop-endpoint" : "SIGTERM";
14228
+ if (graceful === "stop-endpoint") {
14229
+ try {
14230
+ await new DaemonClient(ctx.paths).post("/daemon/stop");
14231
+ } catch {}
14232
+ } else {
14233
+ try {
14234
+ process.kill(lock.pid, "SIGTERM");
14235
+ } catch {}
14236
+ }
14230
14237
  for (let i = 0;i < 100; i += 1) {
14231
14238
  await import_promises5.setTimeout(100);
14232
14239
  if (!isProcessAlive(lock.pid)) {
14233
14240
  removeLock(ctx.paths);
14234
- return { ok: true, stopped: lock.pid, signal: "SIGTERM" };
14241
+ return { ok: true, stopped: lock.pid, signal: graceful };
14235
14242
  }
14236
14243
  }
14237
14244
  try {
@@ -14678,5 +14685,5 @@ async function run(argv = process.argv) {
14678
14685
  await program.parseAsync(argv);
14679
14686
  }
14680
14687
 
14681
- //# debugId=AAE31E672291A0D664756E2164756E21
14688
+ //# debugId=65A54F3F9E054C6B64756E2164756E21
14682
14689
  //# sourceMappingURL=index.cjs.map