Skip to content

Commit

Permalink
Use .fabric extension for the template files
Browse files Browse the repository at this point in the history
  • Loading branch information
traut committed Dec 20, 2023
1 parent cebe8b9 commit 781e06d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.fabric linguist-language=hcl
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type Decoder struct {
}

func argParse() error {
flag.StringVar(&path, "path", "", "a path to a directory with *.hcl files")
flag.StringVar(&path, "path", "", "a path to a directory with *.fabric files")
flag.StringVar(&pluginPath, "plugins", "", "a path to a __plugin file__")
flag.StringVar(&docName, "document", "", "the name of the document to process")
flag.Parse()
Expand Down
4 changes: 2 additions & 2 deletions read_hcl.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ func readAndParse(files []string) (body hcl.Body, fileMap map[string]*hcl.File,

func fromDisk() (body hcl.Body, fileMap map[string]*hcl.File, diags diagnostics.Diagnostics) {
// TODO: replace with filepath.WalkDir()
files, err := filepath.Glob(path + "*.hcl")
files, err := filepath.Glob(path + "*.fabric")
if diags.FromErr(err, "Can't find files") {
return
}
if len(files) == 0 {
diags.Append(&hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Failed to load files",
Detail: fmt.Sprintf("no *.hcl files found at %s", path),
Detail: fmt.Sprintf("no *.fabric files found at %s", path),
})
return
}
Expand Down
File renamed without changes.

0 comments on commit 781e06d

Please sign in to comment.