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

@@ -6,6 +6,7 @@ import (
"log"
"os"
"path/filepath"
"strings"
"gitlab.com/postmarketOS/postmarketos-mkinitfs/internal/filelist"
)
@@ -44,7 +45,7 @@ func (h *HookDirs) List() (*filelist.FileList, error) {
s := bufio.NewScanner(f)
for s.Scan() {
dir := s.Text()
if len(dir) == 0 {
if len(dir) == 0 || strings.HasPrefix(dir, "#") {
continue
}