Skip to content

Commit

Permalink
notifications flag - reversed default behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
resurtm committed Oct 26, 2017
1 parent a6a38c9 commit 8d93826
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Options
--certFile value TLS Certificate
--keyFile value TLS Certificate Key
--logPrefix value Setup custom log prefix
--disableNotifications disable desktop notifications
--notifications enable desktop notifications
--help, -h show help
--version, -v print the version
```
Expand Down
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var (
colorRed = string([]byte{27, 91, 57, 55, 59, 51, 49, 59, 49, 109})
colorReset = string([]byte{27, 91, 48, 109})
notifier = notificator.New(notificator.Options{AppName: "Gin Build"})
notifications = true
notifications = false
)

func main() {
Expand Down Expand Up @@ -117,9 +117,9 @@ func main() {
Value: "gin",
},
cli.BoolFlag{
Name: "disableNotifications",
EnvVar: "GIN_DISABLE_NOTIFICATIONS",
Usage: "Whether desktop notifications should be disabled",
Name: "notifications",
EnvVar: "GIN_NOTIFICATIONS",
Usage: "Enables desktop notifications",
},
}
app.Commands = []cli.Command{
Expand Down Expand Up @@ -149,7 +149,7 @@ func MainAction(c *cli.Context) {
keyFile := c.GlobalString("keyFile")
certFile := c.GlobalString("certFile")
logPrefix := c.GlobalString("logPrefix")
notifications = !c.GlobalBool("disableNotifications")
notifications = c.GlobalBool("notifications")

logger.SetPrefix(fmt.Sprintf("[%s] ", logPrefix))

Expand Down

0 comments on commit 8d93826

Please sign in to comment.