@aiam/ciba 0.8.4 → 0.8.5
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/ciba.mjs +4 -7
- package/package.json +1 -1
package/ciba.mjs
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* ciba status Show session state
|
|
13
13
|
*/
|
|
14
14
|
import { createECDH, createHash, createDecipheriv, createSign, createPrivateKey, randomBytes } from 'node:crypto';
|
|
15
|
-
import { exec, spawn } from 'node:child_process';
|
|
15
|
+
import { exec, execFileSync, spawn } from 'node:child_process';
|
|
16
16
|
import { existsSync, mkdirSync, readFileSync, writeFileSync, unlinkSync } from 'node:fs';
|
|
17
17
|
import { createServer, createConnection } from 'node:net';
|
|
18
18
|
import { homedir, hostname } from 'node:os';
|
|
@@ -749,13 +749,10 @@ const stopCmd = defineCommand({
|
|
|
749
749
|
meta: { description: 'Stop daemon and clear session' },
|
|
750
750
|
args: {},
|
|
751
751
|
async run() {
|
|
752
|
+
const cfg = loadConfig();
|
|
752
753
|
if (cfg.pid) { try { process.kill(parseInt(cfg.pid)); } catch {} }
|
|
753
|
-
// Kill all orphaned ciba daemon processes
|
|
754
|
-
|
|
755
|
-
try {
|
|
756
|
-
const { execFileSync } = await import('node:child_process');
|
|
757
|
-
execFileSync('pkill', ['-f', 'ciba login --daemon'], { stdio: 'ignore' });
|
|
758
|
-
} catch { /* pkill not found or no matching processes */ }
|
|
754
|
+
// Kill all orphaned ciba daemon processes.
|
|
755
|
+
try { execFileSync('pkill', ['-f', 'ciba login --daemon'], { stdio: 'ignore' }); } catch {}
|
|
759
756
|
if (existsSync(SOCKET_PATH)) unlinkSync(SOCKET_PATH);
|
|
760
757
|
const sessionFile = join(CONFIG_DIR, 'session');
|
|
761
758
|
if (existsSync(sessionFile)) unlinkSync(sessionFile);
|
package/package.json
CHANGED