more tests on push command
[teamcity/dotNetPackagesSupport.git] / nuget-agent / src / jetbrains / buildServer / nuget / agent / commands / impl / CommandFactoryImpl.java
index ce2d78411847322237e8d20849275f0868f8e1e2..af7920eefb71765a30fc29c0c0f987d1b47f549d 100644 (file)
@@ -72,11 +72,17 @@ public class CommandFactoryImpl implements CommandFactory {
   public <T> T createPush(@NotNull final NuGetPublishParameters params,\r
                           @NotNull final File packagePath,\r
                           @NotNull final Callback<T> factory) throws RunBuildException {\r
-    return executeNuGet(params, Arrays.asList(params.getPublishSource()),\r
-            Arrays.asList(\r
-                    packagePath.getPath(),\r
-                    params.getApiKey()\r
-            ),\r
+    final List<String> arguments = new ArrayList<String>();\r
+    arguments.add(packagePath.getPath());\r
+    arguments.add(params.getApiKey());\r
+    if (params.getCreateOnly()) {\r
+      arguments.add("-CreateOnly");\r
+    }\r
+\r
+    return executeNuGet(\r
+            params,\r
+            Arrays.asList(params.getPublishSource()),\r
+            arguments,\r
             packagePath.getParentFile(),\r
             factory);\r
   }\r