Example #1
0
        private IList<BottleExplosionRequest> getExplosionRequests(IPackageLog log, IEnumerable<PackageManifest> manifests, IBottleDestination destination)
        {
            List<BottleExplosionRequest> explosionRequests;
            string currentManifest="<empty>";
            try
            {
                explosionRequests = manifests.SelectMany(m=>
                {
                    currentManifest = m.Name;
                    return destination.DetermineExplosionRequests(m);
                }).ToList();

                log.Trace("Explosion requests: '{0}'", explosionRequests.Count);
            }
            catch (Exception ex)
            {
                throw new Exception("Problem building the explosion requests for '{0}'".ToFormat(currentManifest), ex);
            }
            return explosionRequests;
        }
Example #2
0
        public void Move(IPackageLog log, IBottleDestination destination, IEnumerable<BottleReference> references)
        {
            var manifests = references.Select(r =>
            {
                log.Trace("Reading manifest for bottle '{0}'", r.Name);
                return _repository.ReadManifest(r.Name);
            });

            var explosionRequests = getExplosionRequests(log, manifests, destination);

            foreach (var request in explosionRequests)
            {
                log.Trace("Exploding: '{0}' from '{1}' to '{2}'", request.BottleName, request.BottleDirectory, request.DestinationDirectory);
                _repository.ExplodeFiles(request);
            }
        }