@@ -28,6 +28,7 @@ public StartElectronCommand(string[] args)
2828 private string _clearCache = "clear-cache" ;
2929 private string _paramPublishReadyToRun = "PublishReadyToRun" ;
3030 private string _paramDotNetConfig = "dotnet-configuration" ;
31+ private string _paramTarget = "target" ;
3132
3233 public Task < bool > ExecuteAsync ( )
3334 {
@@ -59,8 +60,6 @@ public Task<bool> ExecuteAsync()
5960 Directory . CreateDirectory ( tempPath ) ;
6061 }
6162
62- var platformInfo = GetTargetPlatformInformation . Do ( string . Empty , string . Empty ) ;
63-
6463 string tempBinPath = Path . Combine ( tempPath , "bin" ) ;
6564 var resultCode = 0 ;
6665
@@ -74,6 +73,21 @@ public Task<bool> ExecuteAsync()
7473 publishReadyToRun += "true" ;
7574 }
7675
76+ // If target is specified as a command line argument, use it.
77+ // Format is the same as the build command.
78+ // If target is not specified, autodetect it.
79+ var platformInfo = GetTargetPlatformInformation . Do ( string . Empty , string . Empty ) ;
80+ if ( parser . Arguments . ContainsKey ( _paramTarget ) )
81+ {
82+ var desiredPlatform = parser . Arguments [ _paramTarget ] [ 0 ] ;
83+ string specifiedFromCustom = string . Empty ;
84+ if ( desiredPlatform == "custom" && parser . Arguments [ _paramTarget ] . Length > 1 )
85+ {
86+ specifiedFromCustom = parser . Arguments [ _paramTarget ] [ 1 ] ;
87+ }
88+ platformInfo = GetTargetPlatformInformation . Do ( desiredPlatform , specifiedFromCustom ) ;
89+ }
90+
7791 string configuration = "Debug" ;
7892 if ( parser . Arguments . ContainsKey ( _paramDotNetConfig ) )
7993 {
0 commit comments