zones: switch to using hackpadfs/os.FS as the standard os.FS is incomplete
Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
+8
-2
@@ -3,7 +3,8 @@ package zones
|
||||
|
||||
import (
|
||||
"io/fs"
|
||||
"os"
|
||||
|
||||
"github.com/hack-pad/hackpadfs/os"
|
||||
|
||||
"darvaza.org/resolver"
|
||||
)
|
||||
@@ -104,5 +105,10 @@ func NewFS(dir fs.FS, domain string) (*Zones, error) {
|
||||
|
||||
// New builds a [Zones] tree using the given directory
|
||||
func New(dir, domain string) (*Zones, error) {
|
||||
return NewFS(os.DirFS(dir), domain)
|
||||
base, err := os.NewFS().Sub(dir)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return NewFS(base, domain)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user