Ejemplo n.º 1
0
        public async Task Invoke(NuGetVersion newVersion, string packageSource, PackageInProject currentPackage)
        {
            var dirName   = currentPackage.Path.Info.DirectoryName;
            var nuget     = NuGetPath.FindExecutable();
            var sources   = GetSourcesCommandLine(_sources);
            var arguments = $"update packages.config -Id {currentPackage.Id} -Version {newVersion} {sources}";

            _logger.Verbose(arguments);

            await _externalProcess.Run(dirName, nuget, arguments, true);
        }
Ejemplo n.º 2
0
        public async Task Invoke(FileInfo file)
        {
            _logger.Info($"Nuget restore on {file.DirectoryName} {file.Name}");
            var nuget   = NuGetPath.FindExecutable();
            var sources = GetSourcesCommandLine(_sources);

            var updateCommand = $"cd {file.DirectoryName} & {nuget} restore {file.Name} {sources}";

            _logger.Verbose(updateCommand);

            var processOutput = await _externalProcess.Run(updateCommand, ensureSuccess : false);

            if (processOutput.Success)
            {
                _logger.Verbose($"Nuget restore on {file.Name} complete");
            }
            else
            {
                _logger.Verbose($"Restore failed on {file.DirectoryName} {file.Name}:\n{processOutput.Output}\n{processOutput.ErrorOutput}");
            }
        }