@@ -131,9 +131,8 @@ export class PlatformService implements IPlatformService {
131
131
132
132
public preparePlatform ( platform : string ) : IFuture < void > {
133
133
return ( ( ) => {
134
- platform = platform . toLowerCase ( ) ;
135
-
136
134
this . validatePlatformInstalled ( platform ) ;
135
+ platform = platform . toLowerCase ( ) ;
137
136
138
137
var platformData = this . $platformsData . getPlatformData ( platform ) ;
139
138
var platformProjectService = platformData . platformProjectService ;
@@ -156,8 +155,8 @@ export class PlatformService implements IPlatformService {
156
155
157
156
public buildPlatform ( platform : string ) : IFuture < void > {
158
157
return ( ( ) => {
159
- platform = platform . toLowerCase ( ) ;
160
158
this . validatePlatformInstalled ( platform ) ;
159
+ platform = platform . toLowerCase ( ) ;
161
160
162
161
var platformData = this . $platformsData . getPlatformData ( platform ) ;
163
162
platformData . platformProjectService . buildProject ( platformData . projectRoot ) . wait ( ) ;
@@ -167,9 +166,8 @@ export class PlatformService implements IPlatformService {
167
166
168
167
public runPlatform ( platform : string ) : IFuture < void > {
169
168
return ( ( ) => {
170
- platform = platform . toLowerCase ( ) ;
171
-
172
169
this . validatePlatformInstalled ( platform ) ;
170
+ platform = platform . toLowerCase ( ) ;
173
171
174
172
this . preparePlatform ( platform ) . wait ( ) ;
175
173
this . buildPlatform ( platform ) . wait ( ) ;
@@ -193,6 +191,12 @@ export class PlatformService implements IPlatformService {
193
191
}
194
192
195
193
private validatePlatform ( platform : string ) : void {
194
+ if ( ! platform ) {
195
+ this . $errors . fail ( "No platform specified." )
196
+ }
197
+
198
+ platform = platform . toLowerCase ( ) ;
199
+
196
200
if ( ! this . isValidPlatform ( platform ) ) {
197
201
this . $errors . fail ( "Invalid platform %s. Valid platforms are %s." , platform , helpers . formatListOfNames ( this . $platformsData . platformsNames ) ) ;
198
202
}
0 commit comments