Implemented package imports
This commit is contained in:
parent
3e5adff5e5
commit
fcc4f8d2d9
21 changed files with 510 additions and 353 deletions
24
src/build/scanner/queueDirectory.go
Normal file
24
src/build/scanner/queueDirectory.go
Normal file
|
@ -0,0 +1,24 @@
|
|||
package scanner
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"git.akyoto.dev/cli/q/src/build/fs"
|
||||
)
|
||||
|
||||
// queueDirectory queues an entire directory to be scanned.
|
||||
func (s *Scanner) queueDirectory(directory string, pkg string) {
|
||||
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
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue