filelist/*: support comment lines starting with # (MR 41)

This commit is contained in:
Clayton Craft
2023-08-24 16:41:26 -07:00
parent 30681d2f0a
commit fedf55b573
4 changed files with 14 additions and 5 deletions

View File

@@ -95,10 +95,9 @@ func slurpModules(fd io.Reader, modDir string) (*filelist.FileList, error) {
s := bufio.NewScanner(fd)
for s.Scan() {
line := s.Text()
if len(line) == 0 {
if len(line) == 0 || strings.HasPrefix(line, "#") {
continue
}
dir, file := filepath.Split(line)
if file == "" {
// item is a directory
@@ -199,7 +198,7 @@ func getModuleDeps(modName string, modulesDep io.Reader) ([]string, error) {
s := bufio.NewScanner(modulesDep)
for s.Scan() {
line := s.Text()
if len(line) == 0 {
if len(line) == 0 || strings.HasPrefix(line, "#") {
continue
}