Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ignoreConflicts parameter to paket push #2720

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/app/Fake.DotNet.Paket/Paket.fs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ module Paket =

/// API key for the URL (default: value of the NUGET_KEY environment variable)
ApiKey: string

/// Ignore any HTTP409 (Conflict) errors and treat as success (default: false)
IgnoreConflicts: bool
}

/// Paket push default parameters
Expand All @@ -143,7 +146,8 @@ module Paket =
EndPoint = null
WorkingDir = "./temp"
DegreeOfParallelism = 8
ApiKey = null }
ApiKey = null
IgnoreConflicts = false }

/// <summary>
/// Paket restore packages type
Expand Down Expand Up @@ -206,6 +210,7 @@ module Paket =
|> Arguments.appendNotEmpty "--url" parameters.PublishUrl
|> Arguments.appendNotEmpty "--endpoint" parameters.EndPoint
|> Arguments.appendNotEmpty "--api-key" parameters.ApiKey
|> Arguments.appendIf parameters.IgnoreConflicts "--ignoreConflicts"
|> Arguments.append [ file ]
|> startPaket parameters.ToolType parameters.ToolPath parameters.WorkingDir parameters.TimeOut
| Pack parameters ->
Expand Down
18 changes: 17 additions & 1 deletion src/test/Fake.Core.UnitTests/Fake.DotNet.Paket.fs
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,20 @@ let tests =

let cmd = args |> Arguments.toStartInfo
Expect.stringContains (file.ToLower()) "paket" "Expected paket"
Expect.equal cmd "push testfile" "expected push command line" ]
Expect.equal cmd "push testfile" "expected push command line"
testCase "Test push --ignoreConflicts is not missing"
<| fun _ ->
let cp =
Paket.createProcess (
Paket.StartType.PushFile({ Paket.PaketPushDefaults() with IgnoreConflicts = true }, "testfile")
)

let file, args =
match cp.Command with
| RawCommand (file, args) -> file, args
| _ -> failwithf "expected RawCommand"
|> ArgumentHelper.checkIfMono

let cmd = args |> Arguments.toStartInfo
Expect.stringContains (file.ToLower()) "paket" "Expected paket"
Expect.equal cmd "push --ignoreConflicts testfile" "expected push command line" ]