wrap nuget call with cmd.exe calls, do not show api key
[teamcity/dotNetPackagesSupport.git] / nuget-agent / src / jetbrains / buildServer / nuget / agent / util / impl / CommandlineBuildProcessFactoryImpl.java
index c104b9823bd3a72125148c636705536dc44f6d5b..45608c5029793e1e77f45be8ac4800337095f650 100644 (file)
@@ -25,7 +25,9 @@ import jetbrains.buildServer.runner.SimpleRunnerConstants;
 import org.jetbrains.annotations.NotNull;\r
 \r
 import java.io.File;\r
+import java.util.ArrayList;\r
 import java.util.Collection;\r
+import java.util.List;\r
 import java.util.Map;\r
 \r
 /**\r
@@ -42,9 +44,14 @@ public class CommandlineBuildProcessFactoryImpl implements CommandlineBuildProce
   @NotNull\r
   public BuildProcess executeCommandLine(@NotNull BuildRunnerContext hostContext,\r
                                          @NotNull File program,\r
-                                         @NotNull Collection<String> argz,\r
+                                         @NotNull Collection<String> _argz,\r
                                          @NotNull File workingDir,\r
                                          @NotNull final Map<String, String> additionalEnvironment) throws RunBuildException {\r
+    final List<String> argz = new ArrayList<String>();\r
+    argz.add("/c");\r
+    argz.add(program.getPath());\r
+    argz.addAll(_argz);\r
+\r
     BuildRunnerContext context = myFacade.createBuildRunnerContext(\r
             hostContext.getBuild(),\r
             SimpleRunnerConstants.TYPE,\r
@@ -56,7 +63,7 @@ public class CommandlineBuildProcessFactoryImpl implements CommandlineBuildProce
       context.addEnvironmentVariable(entry.getKey(), entry.getValue());\r
     }\r
 \r
-    context.addRunnerParameter(SimpleRunnerConstants.COMMAND_EXECUTABLE, program.getPath());\r
+    context.addRunnerParameter(SimpleRunnerConstants.COMMAND_EXECUTABLE, "%env.ComSpec%");\r
     context.addRunnerParameter(SimpleRunnerConstants.COMMAND_PARAMETERS, joinCommandLineArguments(argz));\r
 \r
     return myFacade.createExecutable(hostContext.getBuild(), context);\r