Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions packages/fuchsia_ctl/analysis_options.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions packages/fuchsia_ctl/lib/src/dev_finder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,11 @@ class DevFinder {

/// The exception thrown when a [DevFinder] lookup fails.
class DevFinderException implements Exception {
/// Creates a new [DevFinderException], such as when dev_finder fails to find
/// a device.
const DevFinderException(this.message);

/// The user-facing message to display.
final String message;

@override
Expand Down
2 changes: 1 addition & 1 deletion packages/fuchsia_ctl/lib/src/image_paver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ImagePaver {
/// The [FileSystem] implementation used to
final FileSystem fs;

// The implementation to use for untarring system images.
/// The implementation to use for untarring system images.
final Tar tar;

/// The implementation to use for creating SSH keys.
Expand Down
1 change: 1 addition & 0 deletions packages/fuchsia_ctl/lib/src/operation_result.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class OperationResult {
return OperationResult._(false, info: info, error: error);
}

/// Creates an [OperationResult] from a [ProcessResult].
factory OperationResult.fromProcessResult(
ProcessResult result, {
int expectedExitCode = 0,
Expand Down
4 changes: 4 additions & 0 deletions packages/fuchsia_ctl/lib/src/ssh_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ class SshClient {
/// The [ProcessManager] to use for spawning `ssh`.
final ProcessManager processManager;

/// Creates a list of arguments to pass to ssh.
///
/// This method is not intended for use outside of this library, except for
/// in unit tests.
@visibleForTesting
List<String> getSshArguments({
String identityFilePath,
Expand Down
11 changes: 10 additions & 1 deletion packages/fuchsia_ctl/lib/src/ssh_key_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,21 @@ abstract class SshKeyManager {
/// A class that delegates creating SSH keys to the system `ssh-keygen`.
@immutable
class SystemSshKeyManager implements SshKeyManager {
/// Creates a wrapper for ssh-keygen.
///
/// The arguments must not be null, and will be used to spawn a ssh-keygen
/// process and manipulate the files it creates.
const SystemSshKeyManager({
this.processManager = const LocalProcessManager(),
this.fs = const LocalFileSystem(),
});
}) : assert(processManager != null),
assert(fs != null);

/// The [ProcessManager] implementation to use when spawning ssh-keygen.
final ProcessManager processManager;

/// The [FileSystem] implementation to use when creating the authorized_keys
/// file.
final FileSystem fs;

@override
Expand Down
3 changes: 3 additions & 0 deletions packages/fuchsia_ctl/lib/src/tar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ abstract class Tar {
/// A const constructor to allow subclasses to create const constructors.
const Tar();

/// Untars a tar file.
Future<OperationResult> untar(String src, String destination);
}

Expand All @@ -30,6 +31,8 @@ class SystemTar implements Tar {
this.processManager = const LocalProcessManager(),
}) : assert(processManager != null);

/// The [ProcessManager] impleemntation to use when spawning the system tar
/// program.
final ProcessManager processManager;

@override
Expand Down