|
|
|
@ -3,6 +3,7 @@ package zones
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
|
"io/fs" |
|
|
|
|
"path/filepath" |
|
|
|
|
|
|
|
|
|
"github.com/hack-pad/hackpadfs/os" |
|
|
|
|
|
|
|
|
@ -105,7 +106,12 @@ 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) { |
|
|
|
|
base, err := os.NewFS().Sub(dir) |
|
|
|
|
dir, err := filepath.Abs(dir) |
|
|
|
|
if err != nil { |
|
|
|
|
return nil, err |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
base, err := os.NewFS().Sub(dir[1:]) |
|
|
|
|
if err != nil { |
|
|
|
|
return nil, err |
|
|
|
|
} |
|
|
|
|