Skip to content

Commit

Permalink
Fix message when unable to find devices for LiveSync (#3058)
Browse files Browse the repository at this point in the history
In case there are attached, but not trusted devices, `tns run <platform>` command prints error that it is unable to find devices and cannot start emulator when platform is not specified.
But the platform has been specified, so improve the error message in such cases.
  • Loading branch information
rosen-vladimirov authored Aug 14, 2017
1 parent 7605f81 commit ffc7661
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/services/livesync/livesync-command-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ export class LiveSyncCommandHelper implements ILiveSyncCommandHelper {

public async executeLiveSyncOperation(devices: Mobile.IDevice[], liveSyncService: ILiveSyncService, platform: string): Promise<void> {
if (!devices || !devices.length) {
this.$errors.failWithoutHelp("Unable to find applicable devices to execute operation and unable to start emulator when platform is not specified.");
if (platform) {
this.$errors.failWithoutHelp("Unable to find applicable devices to execute operation. Ensure connected devices are trusted and try again.");
} else {
this.$errors.failWithoutHelp("Unable to find applicable devices to execute operation and unable to start emulator when platform is not specified.");
}
}

const workingWithiOSDevices = !platform || this.$mobileHelper.isiOSPlatform(platform);
Expand Down

0 comments on commit ffc7661

Please sign in to comment.