feinai 0.7.1 → 0.7.2
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/CHANGELOG.md +5 -0
- package/package.json +1 -1
- package/src/cli.ts +1 -1
- package/src/server-state.ts +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
5
5
|
|
|
6
|
+
## [0.7.2] - 2026-06-22
|
|
7
|
+
|
|
8
|
+
### Fixed
|
|
9
|
+
- `isPortInUse` / `pidsOnPort` / `portOfPid` usaban `result.exitCode` en vez de `result.status` (API de `child_process.spawnSync`), causando que `findFreePort` nunca detectara puertos ocupados
|
|
10
|
+
|
|
6
11
|
## [0.7.1] - 2026-06-22
|
|
7
12
|
|
|
8
13
|
### Fixed
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
package/src/server-state.ts
CHANGED
|
@@ -45,7 +45,7 @@ export function clearServerState(db: DbInstance): void {
|
|
|
45
45
|
export function isPortInUse(port: number): boolean {
|
|
46
46
|
try {
|
|
47
47
|
const result = spawnSync("lsof", ["-ti", `tcp:${port}`]);
|
|
48
|
-
return result.
|
|
48
|
+
return result.status === 0 && result.stdout.toString().trim().length > 0;
|
|
49
49
|
} catch {
|
|
50
50
|
return false;
|
|
51
51
|
}
|
|
@@ -76,7 +76,7 @@ export function findFreePort(startPort: number): number {
|
|
|
76
76
|
function pidsOnPort(port: number): number[] {
|
|
77
77
|
try {
|
|
78
78
|
const result = spawnSync("lsof", ["-ti", `tcp:${port}`]);
|
|
79
|
-
if (result.
|
|
79
|
+
if (result.status !== 0) return [];
|
|
80
80
|
const out = result.stdout.toString().trim();
|
|
81
81
|
if (!out) return [];
|
|
82
82
|
return out
|
|
@@ -108,7 +108,7 @@ function isPidRunning(pid: number): boolean {
|
|
|
108
108
|
function portOfPid(pid: number): number | null {
|
|
109
109
|
try {
|
|
110
110
|
const result = spawnSync("lsof", ["-iTCP", "-sTCP:LISTEN", "-P", "-n", "-p", String(pid)]);
|
|
111
|
-
if (result.
|
|
111
|
+
if (result.status !== 0) return null;
|
|
112
112
|
// Parse lsof output: find "TCP *:{port}" pattern
|
|
113
113
|
const out = result.stdout.toString();
|
|
114
114
|
const match = out.match(/TCP\s+\*:(\d+)/);
|