Beispiel #1
0
        public void Run(IServiceLocator serviceLocator)
        {
            if (string.IsNullOrEmpty(Source))
            {
                Source = "https://packages.nuget.org/api/v2";
            }

            Logger.Information($"Using nuget repository '{Source}'");

            if (_pluginManager == null)
            {
                _pluginManager = CreatePluginManager(Logger, Source);
            }

            if (List)
            {
                //
                // remy.exe plugins --list
                //
                Logger.Information("Plugins available (tagged 'remy-plugin'):");

                IEnumerable <IPackage> plugins = _pluginManager.List();
                foreach (IPackage package in plugins)
                {
                    string packageName = $"{package.Id}";

                    if (package.Version != null)
                    {
                        packageName += " " + package.Version;
                    }

                    Logger.Information($"{packageName} - {package.Description}");
                }
            }
            else if (!string.IsNullOrEmpty(Install))
            {
                //
                // remy.exe plugins --install=MyId
                //
                Logger.Information($"Downloading plugin '{Install}'");
                _pluginManager.DownloadAndUnzip(Install);
            }
        }