Add directory query

This commit is contained in:
Alex Yatskov 2016-06-05 22:02:09 -07:00
parent a495091b01
commit 53b4d4702c
2 changed files with 5 additions and 0 deletions

View File

@ -99,6 +99,10 @@ func (f *file) Path() string {
return f.path
}
func (f *file) Dir() string {
return path.Dir(f.path)
}
func (f *file) Value(key string) (interface{}, bool) {
value, ok := f.Meta[key]
return value, ok

View File

@ -40,6 +40,7 @@ func Begin(srcDir string) Goldsmith {
type File interface {
Path() string
Dir() string
Value(key string) (interface{}, bool)
SetValue(key string, value interface{})