()
| 176 | } |
| 177 | |
| 178 | func (s *Sync) initIgnoreParsers() error { |
| 179 | if s.Options.ExcludePaths != nil { |
| 180 | ignoreMatcher, err := ignoreparser.CompilePaths(s.Options.ExcludePaths, s.log) |
| 181 | if err != nil { |
| 182 | return errors.Wrap(err, "compile exclude paths") |
| 183 | } |
| 184 | |
| 185 | s.ignoreMatcher = ignoreMatcher |
| 186 | } |
| 187 | |
| 188 | if s.Options.DownloadExcludePaths != nil { |
| 189 | ignoreMatcher, err := ignoreparser.CompilePaths(s.Options.DownloadExcludePaths, s.log) |
| 190 | if err != nil { |
| 191 | return errors.Wrap(err, "compile download exclude paths") |
| 192 | } |
| 193 | |
| 194 | s.downloadIgnoreMatcher = ignoreMatcher |
| 195 | } |
| 196 | |
| 197 | if s.Options.UploadExcludePaths != nil { |
| 198 | ignoreMatcher, err := ignoreparser.CompilePaths(s.Options.UploadExcludePaths, s.log) |
| 199 | if err != nil { |
| 200 | return errors.Wrap(err, "compile upload exclude paths") |
| 201 | } |
| 202 | |
| 203 | s.uploadIgnoreMatcher = ignoreMatcher |
| 204 | } |
| 205 | |
| 206 | return nil |
| 207 | } |
| 208 | |
| 209 | func (s *Sync) mainLoop(onInitUploadDone chan struct{}, onInitDownloadDone chan struct{}) { |
| 210 | s.log.Info("Start syncing") |
no test coverage detected