Skip to content

Commit

Permalink
wip - remove obsolete code and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ansgarm committed Sep 30, 2024
1 parent e34be9d commit 89238e4
Showing 1 changed file with 1 addition and 34 deletions.
35 changes: 1 addition & 34 deletions internal/terraform/datadir/terraform_sources.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,33 +51,10 @@ func (mm *TerraformSources) Copy() *TerraformSources {
return newTfS
}

// func NewModuleManifest(rootDir string, records []ModuleRecord) *ModuleManifest {
// return &ModuleManifest{
// rootDir: rootDir,
// Records: records,
// }
// }

func (tfs *TerraformSources) RootDir() string {
return tfs.rootDir
}

// TODO: parse using go-slug

// func (mm *ModuleManifest) ContainsLocalModule(path string) bool {
// for _, mod := range mm.Records {
// if mod.IsRoot() || mod.IsExternal() {
// continue
// }

// absPath := filepath.Join(mm.RootDir(), mod.Dir)
// if pathcmp.PathEquals(absPath, path) {
// return true
// }
// }
// return false
// }

func ParseTerraformSourcesFromFile(path string) (*TerraformSources, error) {
bundle, err := sourcebundle.OpenDir(path)
if err != nil {
Expand All @@ -88,21 +65,11 @@ func ParseTerraformSourcesFromFile(path string) (*TerraformSources, error) {
Bundle: *bundle,
}

rootDir, ok := ModulePath(path) // TODO: this needs to be done differently for terraform-sources.json
rootDir, ok := ModulePath(path)
if !ok {
return nil, fmt.Errorf("failed to detect module path: %s", path)
}
tfs.rootDir = filepath.Clean(rootDir)

return tfs, nil
}

// func parseModuleManifest(b []byte) (*ModuleManifest, error) {
// mm := ModuleManifest{}
// err := json.Unmarshal(b, &mm)
// if err != nil {
// return nil, err
// }

// return &mm, nil
// }

0 comments on commit 89238e4

Please sign in to comment.