Skip to content

Commit

Permalink
changed env
Browse files Browse the repository at this point in the history
  • Loading branch information
林志宇 committed Mar 28, 2019
1 parent f07c474 commit 3237345
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmd/skywire-node/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,22 @@ 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",
Run: func(_ *cobra.Command, args []string) {
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")
Expand All @@ -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 {
Expand Down

0 comments on commit 3237345

Please sign in to comment.