diff --git a/.gitignore b/.gitignore index 6c0d49ee..451598f0 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ tmp example/ test-reports/ .circleci/config-compiled.yml +.idea/ \ No newline at end of file diff --git a/go.sum b/go.sum index 047239ad..5445a641 100644 --- a/go.sum +++ b/go.sum @@ -262,13 +262,11 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/kyokomi/emoji v2.1.0+incompatible h1:+DYU2RgpI6OHG4oQkM5KlqD3Wd3UPEsX8jamTo1Mp6o= github.com/kyokomi/emoji v2.1.0+incompatible/go.mod h1:mZ6aGCD7yk8j6QY6KICwnZ2pxoszVseX1DNoGtU2tBA= diff --git a/internal/config/projectconfig/project_config.go b/internal/config/projectconfig/project_config.go index 3300011d..acd07328 100644 --- a/internal/config/projectconfig/project_config.go +++ b/internal/config/projectconfig/project_config.go @@ -3,12 +3,13 @@ package projectconfig import ( "errors" "io/ioutil" - "log" - "github.com/commitdev/zero/pkg/util/flog" "github.com/hashicorp/terraform/dag" "github.com/k0kubun/pp" - yaml "gopkg.in/yaml.v2" + "gopkg.in/yaml.v2" + + "github.com/commitdev/zero/pkg/util/exit" + "github.com/commitdev/zero/pkg/util/flog" ) // GraphRootName represents the root of the graph of modules in a project @@ -67,11 +68,11 @@ func LoadConfig(filePath string) *ZeroProjectConfig { config := &ZeroProjectConfig{} data, err := ioutil.ReadFile(filePath) if err != nil { - log.Panicf("failed to read config: %v", err) + exit.Fatal("failed to read config: %v", err) } err = yaml.Unmarshal(data, &config) if err != nil { - log.Panicf("failed to parse config: %v", err) + exit.Fatal("failed to parse config: %v", err) } flog.Debugf("Loaded project config: %s from %s", config.Name, filePath) return config