From f66905f36427aa7b066186d722a8af8d3e2c0275 Mon Sep 17 00:00:00 2001 From: Ben Burwell Date: Tue, 13 Aug 2019 15:49:47 -0400 Subject: remove hardcoded paths --- adopt.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'adopt.go') diff --git a/adopt.go b/adopt.go index 0393d08..2689722 100644 --- a/adopt.go +++ b/adopt.go @@ -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 } -- cgit v1.2.3