@@ -37,6 +37,13 @@ private void Info()
3737 }
3838 }
3939
40+ private bool RunCommand ( string args , out string stdout )
41+ {
42+ var success = dotnetCliInvoker . RunCommand ( args , out var output ) ;
43+ stdout = string . Join ( "\n " , output ) ;
44+ return success ;
45+ }
46+
4047 private static string GetRestoreArgs ( string projectOrSolutionFile , string packageDirectory ) =>
4148 $ "restore --no-dependencies \" { projectOrSolutionFile } \" --packages \" { packageDirectory } \" /p:DisableImplicitNuGetFallbackFolder=true";
4249
@@ -47,9 +54,8 @@ public bool RestoreProjectToDirectory(string projectFile, string packageDirector
4754 {
4855 args += $ " --configfile \" { pathToNugetConfig } \" ";
4956 }
50- var success = dotnetCliInvoker . RunCommand ( args , out var output ) ;
51- stdout = string . Join ( "\n " , output ) ;
52- return success ;
57+
58+ return RunCommand ( args , out stdout ) ;
5359 }
5460
5561 public bool RestoreSolutionToDirectory ( string solutionFile , string packageDirectory , out IEnumerable < string > projects )
@@ -70,16 +76,16 @@ public bool RestoreSolutionToDirectory(string solutionFile, string packageDirect
7076 return false ;
7177 }
7278
73- public bool New ( string folder )
79+ public bool New ( string folder , out string stdout )
7480 {
7581 var args = $ "new console --no-restore --output \" { folder } \" ";
76- return dotnetCliInvoker . RunCommand ( args ) ;
82+ return RunCommand ( args , out stdout ) ;
7783 }
7884
79- public bool AddPackage ( string folder , string package )
85+ public bool AddPackage ( string folder , string package , out string stdout )
8086 {
8187 var args = $ "add \" { folder } \" package \" { package } \" --no-restore";
82- return dotnetCliInvoker . RunCommand ( args ) ;
88+ return RunCommand ( args , out stdout ) ;
8389 }
8490
8591 public IList < string > GetListedRuntimes ( ) => GetListed ( "--list-runtimes" , "runtime" ) ;
@@ -88,7 +94,7 @@ public bool AddPackage(string folder, string package)
8894
8995 private IList < string > GetListed ( string args , string artifact )
9096 {
91- if ( dotnetCliInvoker . RunCommand ( args , out var artifacts ) )
97+ if ( dotnetCliInvoker . RunCommand ( args , out IList < string > artifacts ) )
9298 {
9399 progressMonitor . LogInfo ( $ "Found { artifact } s: { string . Join ( "\n " , artifacts ) } ") ;
94100 return artifacts ;
0 commit comments