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); }
public void DirectoryFilter(string wildcard, string fileFilter) { Assert.That(WildcardToRegex.DirectoryFilter(wildcard), Is.EqualTo(fileFilter)); }
public void ConvertString(string wildcard, string regex) { Assert.That(WildcardToRegex.ConvertString(wildcard), Is.EqualTo(regex)); }