@@ -45,8 +45,10 @@ protected override void ExecuteInternal(string folder, OrganizationServiceContex
45
45
case "unpack" :
46
46
UnPack ( ctx , config ) ;
47
47
break ;
48
+ case "unpacksolution" :
49
+ UnPackFromSolutionZip ( config ) ;
50
+ break ;
48
51
case "pack" :
49
-
50
52
Pack ( ctx , config , false ) ;
51
53
break ;
52
54
case "import" :
@@ -74,6 +76,17 @@ public void UnPack(OrganizationServiceContext ctx, ConfigFile config)
74
76
}
75
77
}
76
78
79
+ public void UnPackFromSolutionZip ( ConfigFile config )
80
+ {
81
+ var configs = config . GetSolutionConfig ( this . Profile ) ;
82
+ foreach ( var solutionPackagerConfig in configs )
83
+ {
84
+ var solutionZip = Path . Combine ( config . filePath , solutionPackagerConfig . solutionpath ) ;
85
+ var movetoFolder = Path . Combine ( config . filePath , solutionPackagerConfig . packagepath ) ;
86
+ UnpackSolutionZip ( solutionPackagerConfig , movetoFolder , solutionZip ) ;
87
+ }
88
+ }
89
+
77
90
public void Pack ( OrganizationServiceContext ctx , ConfigFile config , bool import )
78
91
{
79
92
var configs = config . GetSolutionConfig ( this . Profile ) ;
@@ -84,7 +97,7 @@ public void Pack(OrganizationServiceContext ctx, ConfigFile config, bool import)
84
97
85
98
var version = GetSolutionVersion ( packageFolder ) ;
86
99
87
- // Create the solution zip in the root or the location specified in the spkl.jsomn
100
+ // Create the solution zip in the root or the location specified in the spkl.json
88
101
if ( solutionPackagerConfig . solutionpath != null )
89
102
{
90
103
solutionZipPath = String . Format ( solutionPackagerConfig . solutionpath ,
@@ -223,7 +236,7 @@ private string GetRandomFolder()
223
236
224
237
private string UnPackSolution ( SolutionPackageConfig solutionPackagerConfig , string targetFolder )
225
238
{
226
-
239
+
227
240
// Extract solution
228
241
var request = new ExportSolutionRequest
229
242
{
@@ -247,7 +260,14 @@ private string UnPackSolution(SolutionPackageConfig solutionPackagerConfig, stri
247
260
// Save solution
248
261
var solutionZipPath = Path . GetTempFileName ( ) ;
249
262
File . WriteAllBytes ( solutionZipPath , response . ExportSolutionFile ) ;
250
-
263
+
264
+ UnpackSolutionZip ( solutionPackagerConfig , targetFolder , solutionZipPath ) ;
265
+
266
+ return targetFolder ;
267
+ }
268
+
269
+ private void UnpackSolutionZip ( SolutionPackageConfig solutionPackagerConfig , string targetFolder , string solutionZipPath )
270
+ {
251
271
var binPath = GetPackagerFolder ( ) ;
252
272
var binFolder = new FileInfo ( binPath ) . DirectoryName ;
253
273
@@ -262,11 +282,8 @@ private string UnPackSolution(SolutionPackageConfig solutionPackagerConfig, stri
262
282
) ;
263
283
264
284
RunPackager ( binPath , binFolder , parameters ) ;
265
-
266
- return targetFolder ;
267
285
}
268
286
269
-
270
287
271
288
private string PackSolution ( string rootPath , SolutionPackageConfig solutionPackagerConfig , string solutionZipPath )
272
289
{
0 commit comments