Skip to content

Commit

Permalink
add config override
Browse files Browse the repository at this point in the history
  • Loading branch information
ivantsepp authored and salemhilal committed Aug 29, 2022
1 parent 417edcc commit ea356b2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
17 changes: 9 additions & 8 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ type UrlPattern struct {
}

type Repo struct {
Url string `json:"url"`
MsBetweenPolls int `json:"ms-between-poll"`
Vcs string `json:"vcs"`
VcsConfigMessage *SecretMessage `json:"vcs-config"`
UrlPattern *UrlPattern `json:"url-pattern"`
ExcludeDotFiles bool `json:"exclude-dot-files"`
EnablePollUpdates *bool `json:"enable-poll-updates"`
EnablePushUpdates *bool `json:"enable-push-updates"`
Url string `json:"url"`
MsBetweenPolls int `json:"ms-between-poll"`
Vcs string `json:"vcs"`
VcsConfigMessage *SecretMessage `json:"vcs-config"`
UrlPattern *UrlPattern `json:"url-pattern"`
ExcludeDotFiles bool `json:"exclude-dot-files"`
EnablePollUpdates *bool `json:"enable-poll-updates"`
EnablePushUpdates *bool `json:"enable-push-updates"`
AutoGeneratedFiles []string `json:"auto-generated-files"`
}

// Used for interpreting the config value for fields that use *bool. If a value
Expand Down
9 changes: 8 additions & 1 deletion searcher/searcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,17 @@ func newSearcher(
return nil, err
}

var autoFiles []string
if len(repo.AutoGeneratedFiles) > 0 {
autoFiles = repo.AutoGeneratedFiles
} else {
autoFiles = wd.AutoGeneratedFiles(vcsDir)
}

opt := &index.IndexOptions{
ExcludeDotFiles: repo.ExcludeDotFiles,
SpecialFiles: wd.SpecialFiles(),
AutoGeneratedFiles: wd.AutoGeneratedFiles(vcsDir),
AutoGeneratedFiles: autoFiles,
}

var idxDir string
Expand Down

0 comments on commit ea356b2

Please sign in to comment.