From 730bed976bc63678d027073e060701b03b442754 Mon Sep 17 00:00:00 2001 From: Dimitar Kerezov Date: Wed, 7 Mar 2018 17:45:05 +0200 Subject: [PATCH] feat: fail if bundling both platforms This is currently not possible so throw an error if this is the case --- lib/helpers/livesync-command-helper.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/helpers/livesync-command-helper.ts b/lib/helpers/livesync-command-helper.ts index 64d05fe164..ad917887d9 100644 --- a/lib/helpers/livesync-command-helper.ts +++ b/lib/helpers/livesync-command-helper.ts @@ -31,6 +31,12 @@ export class LiveSyncCommandHelper implements ILiveSyncCommandHelper { await this.$devicesService.detectCurrentlyAttachedDevices({ shouldReturnImmediateResult: false, platform: platform }); const devices = this.$devicesService.getDeviceInstances() .filter(d => !platform || d.deviceInfo.platform.toLowerCase() === platform.toLowerCase()); + + const devicesPlatforms = _(devices).map(d => d.deviceInfo.platform).uniq().value(); + if (this.$options.bundle && devicesPlatforms.length > 1) { + this.$errors.failWithoutHelp("Bundling doesn't work with multiple platforms. Please specify platform to the run command."); + } + await this.executeLiveSyncOperation(devices, platform, additionalOptions); }