Skip to content

Commit

Permalink
Handle quoted includes
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelattwood committed Jan 25, 2024
1 parent 2d5c185 commit a865cae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/natsreloader/natsreloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ func getIncludePaths(configFile string, checked map[string]interface{}) ([]strin
checked[configFile] = nil

parentDirectory := filepath.Dir(configFile)
includeRegex := regexp.MustCompile(`(?m)^\s*include\s+([^\n]*)`)
includeRegex := regexp.MustCompile(`(?m)^\s*include\s+['"]?([^'"\n]*)`)

content, err := os.ReadFile(configFile)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/natsreloader/natsreloadertest/natsreloader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jetstream {
max_file: 10G
}
include ./testConfig_1.conf`
include './testConfig_1.conf'`

testConfig_1 = `include ./testConfig_2.conf`

Expand Down

0 comments on commit a865cae

Please sign in to comment.