From b5ff6b51da3377259fbf3158cef680b80906fc34 Mon Sep 17 00:00:00 2001 From: Matti Paksula Date: Sun, 3 May 2020 13:29:11 +0300 Subject: [PATCH] NIGHTWATCH_DEBUG env --- examples/docker-compose.yml | 3 ++- main.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/docker-compose.yml b/examples/docker-compose.yml index 6bd3341..b7544e1 100644 --- a/examples/docker-compose.yml +++ b/examples/docker-compose.yml @@ -11,7 +11,8 @@ services: build: go-gin-gonic volumes: - ./go-gin-gonic:/app - + environment: + - NIGHTWATCH_DEBUG=${NIGHTWATCH_DEBUG:-no} example: build: . volumes: diff --git a/main.go b/main.go index b4f56c2..ae748d3 100644 --- a/main.go +++ b/main.go @@ -28,7 +28,7 @@ func main() { Version: Version, Usage: "A utility for running arbitrary commands when files change", Before: func(ctx *cli.Context) error { - if ctx.Bool("debug") { + if ctx.Bool("debug") || os.Getenv("NIGHTWATCH_DEBUG") == "yes" { logrus.SetLevel(logrus.DebugLevel) }