ropilot 0.1.39 → 0.1.41
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/lib/proxy.js +19 -9
- package/package.json +1 -1
package/lib/proxy.js
CHANGED
|
@@ -279,17 +279,27 @@ function tryStartRojoServe() {
|
|
|
279
279
|
return; // Not a Rojo project
|
|
280
280
|
}
|
|
281
281
|
|
|
282
|
-
//
|
|
283
|
-
const
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
282
|
+
// Check if rojo is already running (check if port 34872 is in use)
|
|
283
|
+
const check = spawn('lsof -i :34872', [], { shell: true, stdio: 'pipe' });
|
|
284
|
+
let output = '';
|
|
285
|
+
check.stdout.on('data', (data) => { output += data.toString(); });
|
|
286
|
+
check.on('close', (code) => {
|
|
287
|
+
if (output.includes('rojo')) {
|
|
288
|
+
// Rojo already running
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
288
291
|
|
|
289
|
-
|
|
290
|
-
|
|
292
|
+
// Start rojo serve in background
|
|
293
|
+
const child = spawn('rojo serve', [], {
|
|
294
|
+
cwd: process.cwd(),
|
|
295
|
+
detached: true,
|
|
296
|
+
stdio: 'ignore',
|
|
297
|
+
shell: true
|
|
298
|
+
});
|
|
299
|
+
child.unref();
|
|
300
|
+
});
|
|
291
301
|
} catch {
|
|
292
|
-
// Silently ignore
|
|
302
|
+
// Silently ignore
|
|
293
303
|
}
|
|
294
304
|
}
|
|
295
305
|
|