Skip to content

Commit

Permalink
suffix directory with branch if set
Browse files Browse the repository at this point in the history
fixes #28
  • Loading branch information
Southclaws committed Mar 19, 2020
1 parent 3023f29 commit b61ceac
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions service/watcher/reconfigure.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package watcher

import (
"context"
"fmt"
"path/filepath"
"reflect"

Expand Down Expand Up @@ -101,11 +102,15 @@ func (w *Watcher) watchConfig() (err error) {
func (w *Watcher) watchTargets() (err error) {
targetRepos := make([]gitwatch.Repository, len(w.targets))
for i, t := range w.targets {
zap.L().Debug("assigned target", zap.String("url", t.RepoURL))
dir := t.Name
if t.Branch != "" {
dir = fmt.Sprintf("%s_%s", t.Name, t.Branch)
}
zap.L().Debug("assigned target", zap.String("url", t.RepoURL), zap.String("directory", dir))
targetRepos[i] = gitwatch.Repository{
URL: t.RepoURL,
Branch: t.Branch,
Directory: t.Name,
Directory: dir,
}
}

Expand Down

0 comments on commit b61ceac

Please sign in to comment.