From 1e9e0d58f9b5d44b1fcec02e61efcd30818045f5 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Tue, 28 Apr 2015 19:28:51 +0200 Subject: [PATCH] paket push doesn't need a dependencies file any more - fixes #800 --- RELEASE_NOTES.md | 3 +++ src/Paket.Core/PublicAPI.fs | 12 ++++++++++++ src/Paket/Program.fs | 3 +-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 23c68f7eb3..df4c746f70 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,6 @@ +#### 1.2.7 - 28.04.2015 +* `paket push` doesn't need a dependencies file any more - https://github.com/fsprojects/Paket/issues/800 + #### 1.2.6 - 27.04.2015 * Increase timeout for paket push diff --git a/src/Paket.Core/PublicAPI.fs b/src/Paket.Core/PublicAPI.fs index 98eb56d5d5..2a03f13b0c 100644 --- a/src/Paket.Core/PublicAPI.fs +++ b/src/Paket.Core/PublicAPI.fs @@ -274,7 +274,19 @@ type Dependencies(dependenciesFileName: string) = PackageProcess.Pack(dependenciesFile, outputPath, buildConfig, version, releaseNotes) // Push a nupkg file. + [] member this.Push(packageFileName, ?url, ?apiKey, (?endPoint: string), ?maxTrials) = + let urlWithEndpoint = RemoteUpload.GetUrlWithEndpoint url endPoint + let apiKey = defaultArg apiKey (Environment.GetEnvironmentVariable("nugetkey")) + if String.IsNullOrEmpty apiKey then + failwithf "Could not push package %s. Please specify a NuGet API key via environment variable \"nugetkey\"." packageFileName + let maxTrials = defaultArg maxTrials 5 + RemoteUpload.Push maxTrials urlWithEndpoint apiKey packageFileName + + /// Pushes a nupkg file. + static member Push(packageFileName, ?url, ?apiKey, (?endPoint: string), ?maxTrials) = + let currentDirectory = DirectoryInfo(Environment.CurrentDirectory) + let urlWithEndpoint = RemoteUpload.GetUrlWithEndpoint url endPoint let apiKey = defaultArg apiKey (Environment.GetEnvironmentVariable("nugetkey")) if String.IsNullOrEmpty apiKey then diff --git a/src/Paket/Program.fs b/src/Paket/Program.fs index 46441a7b37..4522fb4145 100644 --- a/src/Paket/Program.fs +++ b/src/Paket/Program.fs @@ -166,8 +166,7 @@ let pack (results : ArgParseResults<_>) = let push (results : ArgParseResults<_>) = let fileName = results.GetResult <@ PushArgs.FileName @> - Dependencies.Locate() - .Push(fileName, ?url = results.TryGetResult <@ PushArgs.Url @>, + Dependencies.Push(fileName, ?url = results.TryGetResult <@ PushArgs.Url @>, ?endPoint = results.TryGetResult <@ PushArgs.EndPoint @>, ?apiKey = results.TryGetResult <@ PushArgs.ApiKey @>)