Esempio n. 1
0
        public static void ResetBottleProjectCode()
        {
            var system = new FileSystem();

            system.CleanDirectory(StagingDirectory);
            Thread.Sleep(100);

            system.Copy(SourceDirectory, StagingDirectory);

            system.CreateDirectory(ZipsDirectory);
            system.CleanDirectory(ZipsDirectory);
        }
        public void plan_for_directory()
        {
            var fileSystem = new FileSystem();
            fileSystem.CreateDirectory("deep-root");
            fileSystem.CleanDirectory("deep-root");
            fileSystem.CreateDirectory("deep-root", "foo", "bar");
            fileSystem.CreateDirectory("deep-root", "src");
            fileSystem.CreateDirectory("deep-root", "packaging", "nuget");

            var directories = SolutionDirectory.PlanForDirectory("deep-root");
            directories.OrderBy(x => x.RelativePath).ShouldHaveTheSameElementsAs(
                new SolutionDirectory("foo"),
                new SolutionDirectory("foo/bar"),
                new SolutionDirectory("packaging"),
                new SolutionDirectory("packaging/nuget"),
                new SolutionDirectory("src")
                );
        }
 public void SetUp()
 {
     system = new FileSystem();
     system.CleanDirectory("firefly");
 }
Esempio n. 4
0
            public SolutionGraphScenarioDefinition()
            {
                _directory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Guid.NewGuid().ToString());
                var system = new FileSystem();

                system.CleanDirectory(_directory);
                system.DeleteDirectory(_directory);
                system.DeleteDirectory(_directory);
                system.CreateDirectory(_directory);
            }
 public static void CleanStagingDirectory()
 {
     var system = new FileSystem();
     system.CleanDirectory(StagingDirectory);
     Thread.Sleep(100);
 }
Esempio n. 6
0
        public IPackage ExplodeTo(string directory)
        {
            var explodedDirectory = ExplodedDirectory(directory);

            RippleLog.Info("Exploding to " + explodedDirectory);

            var fileSystem = new FileSystem();
            fileSystem.CreateDirectory(explodedDirectory);
            fileSystem.CleanDirectory(explodedDirectory);

            var package = new ZipPackage(_path);

            package.GetFiles().Each(file => {
                var target = explodedDirectory.AppendPath(file.Path);
                fileSystem.CreateDirectory(target.ParentDirectory());

                using (var stream = new FileStream(target, FileMode.Create, FileAccess.Write))
                {
                    file.GetStream().CopyTo(stream);
                }
            });

            fileSystem.CopyToDirectory(_path, explodedDirectory);

            fileSystem.DeleteFile(_path);

            var newFile = Path.Combine(explodedDirectory, Path.GetFileName(_path));
            return new ZipPackage(newFile);
        }
Esempio n. 7
0
        public static TemplatePlan CreateClean(string directory)
        {
            var system = new FileSystem();
            system.CreateDirectory(directory);
            system.CleanDirectory(directory);

            return new TemplatePlan(directory);
        }