cicy-code 0.2.6 → 0.2.8
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/bin/cicy-code.js +9 -3
- package/package.json +1 -1
package/bin/cicy-code.js
CHANGED
|
@@ -50,7 +50,7 @@ async function main() {
|
|
|
50
50
|
new Promise(r => setTimeout(() => r(null), 3000))
|
|
51
51
|
]);
|
|
52
52
|
|
|
53
|
-
if (latest) {
|
|
53
|
+
if (latest && !process.env.CICY_SKIP_UPDATE) {
|
|
54
54
|
console.log(`\n Update available: ${pkg.version} → ${latest}`);
|
|
55
55
|
console.log(` Updating...\n`);
|
|
56
56
|
try {
|
|
@@ -125,15 +125,21 @@ function waitForServer(port, timeout) {
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
async function launchDesktop() {
|
|
128
|
-
const port = process.env.PORT ||
|
|
128
|
+
const port = process.env.PORT || 8008;
|
|
129
129
|
const desktopPort = 18101;
|
|
130
130
|
|
|
131
|
+
// 0. Kill existing electron/cicy-code and free ports
|
|
132
|
+
try { execSync(`pkill -f 'electron' 2>/dev/null || true`, { shell: true }); } catch {}
|
|
133
|
+
try { execSync(`lsof -ti:${desktopPort} | xargs kill -9 2>/dev/null || true`, { shell: true }); } catch {}
|
|
134
|
+
try { execSync(`lsof -ti:${port} | xargs kill -9 2>/dev/null || true`, { shell: true }); } catch {}
|
|
135
|
+
await new Promise(resolve => setTimeout(resolve, 500));
|
|
136
|
+
|
|
131
137
|
// 1. Start API server in background
|
|
132
138
|
const serverArgs = process.argv.slice(2).filter(a => a !== '--desktop');
|
|
133
139
|
const server = spawn(binPath, serverArgs, {
|
|
134
140
|
stdio: 'ignore',
|
|
135
141
|
detached: true,
|
|
136
|
-
env: process.env
|
|
142
|
+
env: { ...process.env, CICY_NO_BROWSER: '1' }
|
|
137
143
|
});
|
|
138
144
|
server.unref();
|
|
139
145
|
console.log(` 🚀 Starting cicy-code server (PID: ${server.pid})...`);
|