Skip to content

Commit 7d3f1cc

Browse files
authored
Accept both sp and pp files as mod data extension . Closes#4089
1 parent f7622b4 commit 7d3f1cc

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

pkg/constants/extensions.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@ package constants
22

33
import "github.com/turbot/go-kit/helpers"
44

5+
var ModDataExtensions = []string{".sp", "*.pp"}
6+
57
const (
68
PluginExtension = ".plugin"
79
ConfigExtension = ".spc"
810
SqlExtension = ".sql"
9-
MarkdownExtension = ".md"
10-
ModDataExtension = ".sp"
1111
VariablesExtension = ".spvars"
1212
AutoVariablesExtension = ".auto.spvars"
1313
JsonExtension = ".json"
14-
CsvExtension = ".csv"
1514
TextExtension = ".txt"
1615
SnapshotExtension = ".sps"
1716
TokenExtension = ".tptt"

pkg/steampipeconfig/load_mod.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@ func LoadModResourceNames(ctx context.Context, mod *modconfig.Mod, parseCtx *par
234234
// GetModFileExtensions returns list of all file extensions we care about
235235
// this will be the mod data extension, plus any registered extensions registered in fileToResourceMap
236236
func GetModFileExtensions() []string {
237-
return append(modconfig.RegisteredFileExtensions(), constants.ModDataExtension, constants.VariablesExtension)
237+
res := append(modconfig.RegisteredFileExtensions(), constants.ModDataExtensions...)
238+
return append(res, constants.VariablesExtension)
238239
}
239240

240241
// build list of all filepaths we need to parse/load the mod

pkg/workspace/workspace.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ func (w *Workspace) getParseContext(ctx context.Context) (*parse.ModParseContext
383383
Flags: w.listFlag,
384384
Exclude: w.exclusions,
385385
// only load .sp files
386-
Include: filehelpers.InclusionsFromExtensions([]string{constants.ModDataExtension}),
386+
Include: filehelpers.InclusionsFromExtensions(constants.ModDataExtensions),
387387
})
388388

389389
return parseCtx, nil

0 commit comments

Comments
 (0)