Despite landing #184831, this code is still killing processes that don't match the argument list
|
// Check if process is already running from a previous Flutter command. If it is, kill it |
|
// so we don't have the process running twice. When this process is run twice, it'll cause |
|
// one to error. The new process will pick up where the old one left off. |
|
final RunResult result = await _processUtils.run([ |
|
'pgrep', |
|
'-n', // Select only the newest |
|
'-f', // Match against full argument lists |
|
...command, |
|
]); |
|
if (result.exitCode == 0) { |
|
final int? pid = int.tryParse(result.stdout.trim()); |
|
if (pid != null) { |
|
_logger.printTrace( |
|
'Swift Package Manager dependencies are already being fetched by PID $pid', |
|
); |
|
await _processUtils.run(['kill', '$pid']); |
|
} |
|
} |
|
} |
Related: #184754
Despite landing #184831, this code is still killing processes that don't match the argument list
flutter/packages/flutter_tools/lib/src/ios/xcodeproj.dart
Lines 420 to 438 in b0e66e6
Related: #184754