aboutsummaryrefslogtreecommitdiff
path: root/apply.go
diff options
context:
space:
mode:
authorBen Burwell <ben@benburwell.com>2020-06-06 17:02:38 -0400
committerBen Burwell <ben@benburwell.com>2020-06-06 17:02:38 -0400
commitda8aa52b5ce6d948a346d7dbf1254ca3faaeac80 (patch)
tree503ed27704aab39c824abcbd8a08d4f60fb39e49 /apply.go
parent34060154caf34fc8d709135be803e08855496614 (diff)
Add status subcommandstatus
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
-}