Visitar URL original
Make sure command fails properly (#36) · creatorpiyush/packages@5405d0b · GitHub
Skip to content

Commit 5405d0b

Browse files
authored
Make sure command fails properly (flutter#36)
1 parent fd63bf2 commit 5405d0b

4 files changed

Lines changed: 30 additions & 2 deletions

File tree

‎packages/fuchsia_ctl/CHANGELOG.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# CHANGELOG
22

3+
## 0.0.5
4+
5+
- Fix SSH command input so that correct exit code is returned when a command
6+
fails.
7+
38
## 0.0.4
49

510
- Fix issue where tests results were not printing.
11+
12+
## 0.0.3
13+
14+
- Publish correct binaries for Linux
15+
16+
## 0.0.2
17+
18+
- Published with mac binaries tagged as Linux. Do not use.
19+
20+
## 0.0.1
21+
22+
- Initial pre-release for testing. Do not use.

‎packages/fuchsia_ctl/lib/src/ssh_client.dart‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class SshClient {
3131
String targetIp,
3232
List<String> command = const <String>[],
3333
}) {
34+
assert(command != null);
3435
return <String>[
3536
'ssh',
3637
'-o', 'CheckHostIP=no', //
@@ -49,7 +50,7 @@ class SshClient {
4950
'-o', 'ServerAliveCountMax=10',
5051
'-o', 'LogLevel=ERROR',
5152
targetIp,
52-
...command
53+
command.join(' '),
5354
];
5455
}
5556

‎packages/fuchsia_ctl/pubspec.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: >
55
continuous integration/testing infrastructure.
66
author: Flutter Team <flutter-dev@googlegroups.com>
77
homepage: https://github.com/flutter/packags/tree/master/packages/fuchsia_ctl
8-
version: 0.0.4
8+
version: 0.0.5
99

1010
environment:
1111
sdk: ">=2.4.0 <3.0.0"

‎packages/fuchsia_ctl/test/ssh_client_test.dart‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@ void main() {
7777
));
7878
expect(result.success, true);
7979
});
80+
81+
test('getSshArgs', () {
82+
const SshClient ssh = SshClient();
83+
final List<String> args = ssh.getSshArguments(
84+
identityFilePath: identityFilePath,
85+
targetIp: targetIp,
86+
command: const <String>['ls', '-al'],
87+
);
88+
expect(args.last, 'ls -al');
89+
});
8090
}
8191

8292
class MockProcessManager extends Mock implements ProcessManager {}

0 commit comments

Comments
 (0)