Esempio n. 1
0
        public async Task <bool> Execute(ILog log, string workDir)
        {
            if (!Conditions.AreTrue())
            {
                return(true);
            }

            var fileFilter      = WildcardToRegex.FileFilter(SourcePath);
            var directoryFilter = WildcardToRegex.DirectoryFilter(SourcePath);
            var events          = new FastZipEvents();

            events.ProcessFile += (sender, e) => log.LogMessage("Extracting file {0}", e.Name);

            var fastZip = new FastZip(events)
            {
                CreateEmptyDirectories = true
            };

            fastZip.ExtractZip(Path.Combine(workDir, ZipFile), Path.Combine(workDir, DestinationPath), FastZip.Overwrite.Always,
                               fn => true, fileFilter, directoryFilter, true);
            return(true);
        }
Esempio n. 2
0
 public void FileFilter(string wildcard, string fileFilter)
 {
     Assert.That(WildcardToRegex.FileFilter(wildcard), Is.EqualTo(fileFilter));
 }