Skip to content

Commit

Permalink
Ignore errors in DotNetPushChocolateyPackage when IGNORE_CONFLICT is …
Browse files Browse the repository at this point in the history
…true
  • Loading branch information
Numpsy committed Aug 25, 2024
1 parent 06d5178 commit 07ac987
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,7 @@ Target.create "DotNetCreateDebianPackage" (fun _ ->
Target.create "DotNetPushChocolateyPackage" (fun _ ->
let name = sprintf "%s.%s.nupkg" "fake" chocoVersion
let path = sprintf "%s/%s" chocoReleaseDir name
let ignore_conflict = Environment.environVar "IGNORE_CONFLICT" = "true"

if not Environment.isWindows && not (File.exists path) && fromArtifacts then
Directory.ensure chocoReleaseDir
Expand All @@ -975,12 +976,15 @@ Target.create "DotNetPushChocolateyPackage" (fun _ ->
else
{ p with ToolPath = altToolPath }

path
|> Choco.push (fun p ->
{ p with
Source = chocoSource
ApiKey = chocoKey.Value }
|> changeToolPath))
try
path
|> Choco.push (fun p ->
{ p with
Source = chocoSource
ApiKey = chocoKey.Value }
|> changeToolPath)
with exn when ignore_conflict ->
Trace.traceFAKE "ignore conflict error because IGNORE_CONFLICT=true!")

Target.create "DotNetPushToNuGet" (fun _ ->
!!(appDir </> "*/*.fsproj") -- (appDir </> "Fake.netcore/*.fsproj")
Expand Down

0 comments on commit 07ac987

Please sign in to comment.