From da8aa52b5ce6d948a346d7dbf1254ca3faaeac80 Mon Sep 17 00:00:00 2001 From: Ben Burwell Date: Sat, 6 Jun 2020 17:02:38 -0400 Subject: Add status subcommand --- apply.go | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) (limited to 'apply.go') 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 -} -- cgit v1.2.3