diff options
author | Ben Burwell <ben@benburwell.com> | 2019-08-13 15:49:47 -0400 |
---|---|---|
committer | Ben Burwell <ben@benburwell.com> | 2019-08-13 15:49:47 -0400 |
commit | f66905f36427aa7b066186d722a8af8d3e2c0275 (patch) | |
tree | 40cab23108da4a98291aa0d768fb729561ef15d8 /adopt.go | |
parent | e4839bdff00f09ccb4e0a8b12d634d26d172dfc9 (diff) |
remove hardcoded paths
Diffstat (limited to 'adopt.go')
-rw-r--r-- | adopt.go | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -7,21 +7,21 @@ import ( "path/filepath" ) -func adopt(args []string) error { +func adopt(conf *Conf, args []string) error { if len(args) < 1 { return errors.New("must specify at least one file to adopt") } for _, name := range args { - if err := adoptFile(name); err != nil { + if err := adoptFile(conf, name); err != nil { return err } } return nil } -func adoptFile(name string) error { - fromPath := filepath.Join(dest, name) - toPath := filepath.Join(base, "templates", name) +func adoptFile(conf *Conf, name string) error { + fromPath := filepath.Join(conf.Dest, name) + toPath := filepath.Join(conf.Source, "templates", name) if err := os.MkdirAll(filepath.Dir(toPath), 0700); err != nil { return err } |