File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -251,8 +251,10 @@ let createDependenciesFileR (rootDirectory : DirectoryInfo) nugetEnv mode =
251251 if nugetEnv.NugetConfig.PackageSources = [] then [ Constants.DefaultNugetStream, None] else nugetEnv.NugetConfig.PackageSources
252252 |> List.map ( fun ( n , auth ) -> n, auth |> Option.map ( CredsMigrationMode.toAuthentication mode n))
253253 |> List.map ( fun source ->
254- try source |> PackageSource.Parse |> Rop.succeed
255- with _ -> source |> fst |> PackageSourceParseError |> Rop.fail)
254+ try source |> PackageSource.Parse |> succeed
255+ with _ -> source |> fst |> PackageSourceParseError |> fail
256+ |> successTee PackageSource.warnIfNoConnection)
257+
256258 |> Rop.collect
257259
258260 sources
Original file line number Diff line number Diff line change 11module Paket.PackageSources
22
33open System
4+ open System.IO
45open System.Text .RegularExpressions
5- open Logging
6+
7+ open Paket.Logging
8+ open Paket.Rop
69
710type EnvironmentVariable =
811 { Variable : string
@@ -91,4 +94,15 @@ type PackageSource =
9194
9295 static member NugetSource url = Nuget { Url = url; Authentication = None }
9396
97+ static member warnIfNoConnection ( source , _ ) =
98+ match source with
99+ | Nuget { Url = url; Authentication = auth} ->
100+ use client = Utils.createWebClient ( auth |> Option.map toBasicAuth)
101+ try client.DownloadData url |> ignore
102+ with _ ->
103+ traceWarnfn " Unable to ping remote Nuget feed: %s ." url
104+ | LocalNuget path ->
105+ if not <| File.Exists path then
106+ traceWarnfn " Local Nuget feed doesn't exist: %s ." path
107+
94108let DefaultNugetSource = PackageSource.NugetSource Constants.DefaultNugetStream
You can’t perform that action at this time.
0 commit comments