Example #1
0
        public void SavePackages(Action <string> output)
        {
            var packagesFile   = Path.Combine(_fileSystem.CurrentDirectory, Constants.PackagesFile);
            var packagesFolder = Path.Combine(_fileSystem.CurrentDirectory, Constants.PackagesFolder);

            if (_fileSystem.FileExists(packagesFile))
            {
                output("Packages.config already exists!");
                return;
            }

            if (!_fileSystem.DirectoryExists(packagesFolder))
            {
                output("Packages directory does not exist!");
                return;
            }

            var result = _packageContainer.CreatePackageFile().ToList();

            if (!result.Any())
            {
                output("No packages found!");
                return;
            }

            result.ForEach(i => output(string.Format("Added {0}", i)));
            output("Packages.config successfully created!");
        }
        public void SavePackages()
        {
            var packagesFolder = Path.Combine(_fileSystem.CurrentDirectory, Constants.PackagesFolder);

            if (!_fileSystem.DirectoryExists(packagesFolder))
            {
                _logger.Info("Packages directory does not exist!");
                return;
            }

            _packageContainer.CreatePackageFile();
        }