示例#1
0
        static INuGetPackageSources BuildNuGetPackageSources([NotNull] ISnapFilesystem filesystem, [NotNull] ILog logger)
        {
            if (filesystem == null)
            {
                throw new ArgumentNullException(nameof(filesystem));
            }
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            try
            {
                return(new NuGetMachineWidePackageSources(filesystem, filesystem.DirectoryWorkingDirectory()));
            }
            catch (Exception e)
            {
                logger.Error($"Exception thrown while parsing nuget sources: {e.Message}");
                return(null);
            }
        }