Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
Merge pull request #7 from tarosky/issue/6
Browse files Browse the repository at this point in the history
Create nudge file automatically
Close #6.
  • Loading branch information
harai authored Oct 16, 2020
2 parents 0b2de22 + f50a750 commit 44036bf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions nudge.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,15 @@ type nudger struct {
}

func newNudger(nudgeFile string) *nudger {
if _, err := os.Stat(nudgeFile); err != nil {
f, err := os.Create(nudgeFile)
if err != nil {
log.Fatal("unable to create nudge file", zap.Error(err))
}
log.Info("no nudge file found. created.", zap.String("path", nudgeFile))
f.Close()
}

return &nudger{path: nudgeFile, first: true}
}

Expand Down

0 comments on commit 44036bf

Please sign in to comment.