diff options
author | Ben Burwell <ben@benburwell.com> | 2020-06-06 17:02:38 -0400 |
---|---|---|
committer | Ben Burwell <ben@benburwell.com> | 2020-06-06 17:02:38 -0400 |
commit | da8aa52b5ce6d948a346d7dbf1254ca3faaeac80 (patch) | |
tree | 503ed27704aab39c824abcbd8a08d4f60fb39e49 /apply.go | |
parent | 34060154caf34fc8d709135be803e08855496614 (diff) |
Add status subcommandstatus
Diffstat (limited to 'apply.go')
-rw-r--r-- | apply.go | 25 |
1 files changed, 1 insertions, 24 deletions
@@ -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 -} |