Skip to content

Commit

Permalink
interval
Browse files Browse the repository at this point in the history
  • Loading branch information
juliojimenez committed Jun 2, 2021
1 parent 780d0ae commit f058d4d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
9 changes: 7 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,19 @@ var (
repoPath := args[0]
schedule := lib.Schedule{
Interval: "daily",
Time: "05:00",
TimeZone: "UTC",
}
switch {
case interval == "daily":
schedule.Interval = interval
schedule.Time = time
schedule.TimeZone = timeZone
case interval == "weekly":
schedule.Interval = interval
schedule.Day = day
schedule.Time = time
schedule.TimeZone = timeZone
case interval == "monthly":
schedule.Interval = interval
}
lib.Generator(heyBo, repoPath, verbose, schedule)
}
Expand Down
2 changes: 1 addition & 1 deletion lib/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func updatesBuilder(directories []string, ecosystem string, schedule Schedule) [
update := Update{
PackageEcosystem: ecosystem,
Directory: dir,
Schedule: schedule,
Schedule: schedule,
}
updates = append(updates, update)
}
Expand Down
8 changes: 4 additions & 4 deletions lib/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ type Configuration struct {
type Update struct {
PackageEcosystem string `yaml:"package-ecosystem"`
Directory string `yaml:"directory"`
Schedule `yaml:"schedule"`
Schedule `yaml:"schedule"`
}

// Schedule - Update check schedule
type Schedule struct {
Interval string `yaml:"interval"`
Day string `yaml:"day,omitempty"`
Time string `yaml:"time,omitempty"`
Day string `yaml:"day,omitempty"`
Time string `yaml:"time,omitempty"`
TimeZone string `yaml:"timezone,omitempty"`
}
}

0 comments on commit f058d4d

Please sign in to comment.