From 3237345a8b96c97aaea84de932cb564794a2bcd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=BF=97=E5=AE=87?= Date: Fri, 29 Mar 2019 01:15:47 +0800 Subject: [PATCH] changed env --- cmd/skywire-node/commands/root.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/skywire-node/commands/root.go b/cmd/skywire-node/commands/root.go index 7f97e78b07..1d2a6f8d9c 100644 --- a/cmd/skywire-node/commands/root.go +++ b/cmd/skywire-node/commands/root.go @@ -9,13 +9,14 @@ import ( "syscall" "time" - "github.com/skycoin/skywire/internal/pathutil" - "github.com/spf13/cobra" + "github.com/skycoin/skywire/internal/pathutil" "github.com/skycoin/skywire/pkg/node" ) +const configEnv = "SW_CONFIG" + var rootCmd = &cobra.Command{ Use: "skywire-node [skywire.json]", Short: "App Node for skywire", @@ -23,7 +24,7 @@ var rootCmd = &cobra.Command{ var configFile string if len(args) > 0 { configFile = args[0] - } else if conf, ok := os.LookupEnv("SKYWIRE_CONFIG"); ok { + } else if conf, ok := os.LookupEnv(configEnv); ok { configFile = conf } else { conf, err := pathutil.Find("skywire.json") @@ -33,7 +34,7 @@ var rootCmd = &cobra.Command{ configFile = conf } - log.Println("using conf file at: ", configFile) + log.Println("using conf file at:", configFile) file, err := os.Open(configFile) if err != nil {