Skip to content

Commit

Permalink
fixes no goal set state and starting of timer
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorriegler committed Jun 29, 2024
1 parent 556c91b commit d710bcf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion goal/goal.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func Goal(configuration config.Configuration, parameter []string) {

func goal(configuration config.Configuration, parameter []string) error {
if configuration.TimerRoom == "" {
return errors.New("No room sepcified. Set MOB_TIMER_ROOM to your timer.mob.sh room in .mob file.")
return errors.New("No room specified. Set MOB_TIMER_ROOM to your timer.mob.sh room in .mob file.")
}
var err error
if len(parameter) <= 0 {
Expand Down Expand Up @@ -114,6 +114,9 @@ func getGoalHttp(room string, timerService string, disableSslVerification bool)
if response.StatusCode >= 300 {
return "", errors.New("got an error while requesting it: " + url + " " + response.Status)
}
if response.StatusCode == 204 {
return "", nil
}
body, err := io.ReadAll(response.Body)
if err != nil {
say.Debug(err.Error())
Expand Down
2 changes: 1 addition & 1 deletion timer.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

func StartTimer(timerInMinutes string, configuration config.Configuration) {
if err := startTimer(configuration.Timer, configuration); err != nil {
if err := startTimer(timerInMinutes, configuration); err != nil {
Exit(1)
}
}
Expand Down

0 comments on commit d710bcf

Please sign in to comment.