Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/google/uuid v1.6.0
github.com/hashicorp/go-hclog v1.6.3
github.com/hashicorp/go-plugin v1.8.0
github.com/infracost/config v0.10.0
github.com/infracost/config v0.11.0
github.com/infracost/go-proto v1.25.1
github.com/infracost/proto v1.156.0
github.com/liamg/tml v0.7.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ github.com/hashicorp/yamux v0.1.2 h1:XtB8kyFOyHXYVFnwT5C3+Bdo8gArse7j2AQ0DA0Uey8
github.com/hashicorp/yamux v0.1.2/go.mod h1:C+zze2n6e/7wshOZep2A70/aQU6QBRWJO/G6FT1wIns=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/infracost/config v0.10.0 h1:ogKYk2Q416ntcypADCkQWaEyPL9zZlvECHOq7M+oRt8=
github.com/infracost/config v0.10.0/go.mod h1:IfWRgSkjAuSRowYwzGEw/fYTCDEGc/XU10U3sIj/YWs=
github.com/infracost/config v0.11.0 h1:CYzIOu9bmbZVeMO6jqKn18VG55uTB/2nlgLFSsZDEX8=
github.com/infracost/config v0.11.0/go.mod h1:IfWRgSkjAuSRowYwzGEw/fYTCDEGc/XU10U3sIj/YWs=
github.com/infracost/go-proto v1.25.1 h1:34bfSUVRFsbTBASShBSQ+9IGvUmEg8C89X73Hem/Asw=
github.com/infracost/go-proto v1.25.1/go.mod h1:9m9zdHPl6mME24y3J0CdTBWXr+d03mfgXuy+9JzA/wU=
github.com/infracost/proto v1.156.0 h1:Kmlapuqqn0POosT0L2VgoW5GSUDU4ll9EfeQeKfkuCM=
Expand Down
10 changes: 1 addition & 9 deletions pkg/scanner/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"io"
"os"
"path/filepath"
"strings"

repoconfig "github.com/infracost/config"
"github.com/infracost/proto/gen/go/infracost/usage"
Expand All @@ -27,15 +26,9 @@ func LoadUsageData(r io.Reader, defaults *usage.Usage) (*usage.Usage, error) {
// or generates one if it doesn't exist. If an infracost.yml.tmpl template exists, it is
// used as the basis for generation.
func LoadOrGenerateRepositoryConfig(ctx context.Context, dir string, opts ...repoconfig.GenerationOption) (*repoconfig.Config, error) {
env := make(map[string]string, len(os.Environ()))
for _, kv := range os.Environ() {
key, val, _ := strings.Cut(kv, "=")
env[key] = val
}

configPath := filepath.Join(dir, RepoConfigFilename)
if fileExists(configPath) {
c, err := repoconfig.LoadConfigFile(configPath, dir, env)
c, err := repoconfig.LoadConfigFile(configPath, dir)
if err != nil {
return nil, fmt.Errorf("failed to load config: %w", err)
}
Expand All @@ -44,7 +37,6 @@ func LoadOrGenerateRepositoryConfig(ctx context.Context, dir string, opts ...rep

opts = append(
opts,
repoconfig.WithEnvVars(env),
repoconfig.WithIgnorePermissionErrors(true),
repoconfig.WithIgnoreHiddenDirs(true),
repoconfig.WithSkipCDK(true),
Expand Down
Loading