Skip to content

Commit

Permalink
formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
bsutton committed Mar 20, 2024
1 parent 6050548 commit 55ad00a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
3 changes: 2 additions & 1 deletion dcli/lib/src/process/environment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import 'package:dcli_core/dcli_core.dart';
/// Used internally to pass environment variables across an isolate
/// boundary when using [ProcessSync] to synchronously call a process.
class ProcessEnvironment {
factory ProcessEnvironment() => ProcessEnvironment._(envs, Env().caseSensitive);
factory ProcessEnvironment() =>
ProcessEnvironment._(envs, Env().caseSensitive);

ProcessEnvironment._(this.envVars, this.caseSensitive);

Expand Down
8 changes: 6 additions & 2 deletions dcli/lib/src/process/process/native_calls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,16 @@ class NativeCalls {
/// Don't really know why but we go and find the
/// native dart method to connect to a port.
static Object Function(int) _initNativeConnectToPort() {
final functions = NativeApi.initializeApiDLData.cast<_DartApi>().ref.functions;
final functions =
NativeApi.initializeApiDLData.cast<_DartApi>().ref.functions;

late Object Function(int) connectToPort;
for (var i = 0; functions[i].name != nullptr; i++) {
if (functions[i].name.toDartString() == 'Dart_NewSendPort') {
connectToPort = functions[i].function.cast<NativeFunction<Handle Function(Int64)>>().asFunction();
connectToPort = functions[i]
.function
.cast<NativeFunction<Handle Function(Int64)>>()
.asFunction();
break;
}
}
Expand Down
3 changes: 2 additions & 1 deletion dcli/lib/src/process/process/pipe_sync.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class PipeSync {
/// exit code do we return?
int? get exitCode => _rhsChannel.exitCode;

/// Run the two given process as defined by [lhsSettings] (left-hand-side settings) and [rhsSettings] (right-hand-side settings).
/// Run the two given process as defined by [lhsSettings]
/// (left-hand-side settings) and [rhsSettings] (right-hand-side settings).
/// piping the input from the [lhsSettings] process into the [rhsSettings]
/// process.
///
Expand Down
9 changes: 6 additions & 3 deletions dcli/lib/src/util/runnable_process.dart
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,8 @@ class RunnableProcess {
// (Object e) {
// // forget broken pipe after rhs terminates before lhs
// },
// test: (e) => e is SocketException && e.osError!.message == 'Broken pipe',
// test: (e) => e is SocketException
// && e.osError!.message == 'Broken pipe',
// );
// }

Expand Down Expand Up @@ -538,8 +539,10 @@ class RunnableProcess {
void _waitForStreams() {
// Wait for both streams to complete
// ignore: discarded_futures
// TODO: restore - how do we ensure the output from streams has been processed.
// waitForEx(Future.wait([_stdoutCompleter.future, _stderrCompleter.future]));
// TODO: restore - how do we ensure the output
// from streams has been processed.
// waitForEx(Future.wait([_stdoutCompleter.future,
// _stderrCompleter.future]));
}

final _stdoutCompleter = Completer<bool>();
Expand Down

0 comments on commit 55ad00a

Please sign in to comment.