aboutsummaryrefslogtreecommitdiff
path: root/apply.go
diff options
context:
space:
mode:
Diffstat (limited to 'apply.go')
-rw-r--r--apply.go25
1 files changed, 1 insertions, 24 deletions
diff --git a/apply.go b/apply.go
index ddf12a5..904ffef 100644
--- a/apply.go
+++ b/apply.go
@@ -11,7 +11,7 @@ func apply(conf *Conf, args []string) error {
if len(args) != 0 {
return applyFiles(conf, args)
}
- names, err := getFileNames(conf)
+ names, err := conf.FileNames()
if err != nil {
return err
}
@@ -56,26 +56,3 @@ func applyFile(conf *Conf, name string) error {
}
return nil
}
-
-func getFileNames(c *Conf) ([]string, error) {
- var names []string
- dir := filepath.Join(c.Source, "templates")
- err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
- if err != nil {
- return err
- }
- if info.IsDir() {
- return nil
- }
- name, err := filepath.Rel(dir, path)
- if err != nil {
- return err
- }
- names = append(names, name)
- return nil
- })
- if err != nil {
- return nil, err
- }
- return names, nil
-}