Simplified file structure

This commit is contained in:
Eduard Urbach 2024-08-07 19:39:10 +02:00
parent cacee7260a
commit a466281307
Signed by: eduard
GPG key ID: 49226B848C78F6C8
219 changed files with 453 additions and 457 deletions

View file

@ -0,0 +1,30 @@
package scanner
import (
"path/filepath"
"strings"
"git.akyoto.dev/cli/q/src/fs"
)
// queueDirectory queues an entire directory to be scanned.
func (s *Scanner) queueDirectory(directory string, pkg string) {
_, loaded := s.queued.LoadOrStore(directory, nil)
if loaded {
return
}
err := fs.Walk(directory, func(name string) {
if !strings.HasSuffix(name, ".q") {
return
}
fullPath := filepath.Join(directory, name)
s.queueFile(fullPath, pkg)
})
if err != nil {
s.errors <- err
}
}