func (parser *Parser) buildCopy(excludeKeys, includeKeys []string) error { files, err := parser.Storage.GetAllFiles(parser.Storage.GetSourcePrefix("")) if err != nil { return err } for _, file := range files { if file.IsDir || isUnderscoreOrDotPrefix(file.Path) { continue } sourceKey := parser.Storage.GetSourceKey(file.Path) destinationKey := parser.Storage.GetDestinationKey(file.Path) if stringutils.HasPrefixIgnoreCase(excludeKeys, sourceKey) { if !stringutils.HasPrefixIgnoreCase(includeKeys, sourceKey) { continue } } err := parser.Storage.CopyToDestination(sourceKey, destinationKey) if err != nil { return err } } return nil }
// IsLocalFile returns true if the file is local only func (parser *Parser) IsLocalFile(file *get3w.File) bool { if strings.HasPrefix(file.Path, parser.Config.Destination) { return true } if stringutils.HasPrefixIgnoreCase(localOnlyPrefixes, file.Path) { return true } return false }