Skip to content

Commit e3b0f1d

Browse files
committed
Improve Dev Proxy process detection. Closes #245
Closes #245
1 parent bbb7e3a commit e3b0f1d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717

1818
- Snippets: Updated all snippets to use `v0.28.0` schema
1919
- Commands: Removed configuration commands from editor
20+
- Detection: Improved detection of Dev Proxy processes
2021

2122
### Fixed:
2223

src/detect.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ export const isDevProxyRunning = async (devProxyExe: string): Promise<boolean> =
5454
return processId.trim() !== '';
5555
};
5656
if (platform === 'darwin') {
57-
const processId = await executeCommand(`$SHELL -c "ps -ef | grep ${devProxyExe} | grep -v grep | awk '{print $2}'"`);
57+
const processId = await executeCommand(`$SHELL -c "ps -e -o pid=,comm= | awk \'\\$2==\"${devProxyExe}\" {print \\$1}\'"`);
5858
return processId.trim() !== '';
5959
};
6060
if (platform === 'linux') {
61-
const processId = await executeCommand(`/bin/bash -c "ps -ef | grep ${devProxyExe} | grep -v grep | awk '{print $2}'"`);
61+
const processId = await executeCommand(`/bin/bash -c "ps -e -o pid=,comm= | awk \'\\$2==\"${devProxyExe}\" {print \\$1}\'"`);
6262
return processId.trim() !== '';
6363
}
6464
return false;

0 commit comments

Comments
 (0)