[fuchsia] Get Dart VM service ports from The Hub (#25332)
This commit is contained in:
@@ -13,9 +13,6 @@ import 'package:fuchsia_remote_debug_protocol/fuchsia_remote_debug_protocol.dart
|
||||
|
||||
import 'error.dart';
|
||||
|
||||
// TODO(awdavies): Update this to use the hub.
|
||||
final Directory _kDartPortDir = Directory('/tmp/dart.services');
|
||||
|
||||
class _DummyPortForwarder implements PortForwarder {
|
||||
_DummyPortForwarder(this._port, this._remotePort);
|
||||
|
||||
@@ -49,13 +46,13 @@ class _DummySshCommandRunner implements SshCommandRunner {
|
||||
@override
|
||||
Future<List<String>> run(String command) async {
|
||||
try {
|
||||
return List<String>.of(_kDartPortDir
|
||||
.listSync(recursive: false, followLinks: false)
|
||||
.map((FileSystemEntity entity) => entity.path
|
||||
.replaceAll(entity.parent.path, '')
|
||||
.replaceFirst(Platform.pathSeparator, '')));
|
||||
} on FileSystemException catch (e) {
|
||||
_log.warning('Error listing directory: $e');
|
||||
final List<String> splitCommand = command.split(' ');
|
||||
final String exe = splitCommand[0];
|
||||
final List<String> args = splitCommand.skip(1).toList();
|
||||
final ProcessResult r = Process.runSync(exe, args);
|
||||
return r.stdout.split('\n');
|
||||
} on ProcessException catch (e) {
|
||||
_log.warning("Error running '$command': $e");
|
||||
}
|
||||
return <String>[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user