aboutsummaryrefslogtreecommitdiff
path: root/adopt.go
diff options
context:
space:
mode:
authorBen Burwell <ben@benburwell.com>2019-08-13 15:49:47 -0400
committerBen Burwell <ben@benburwell.com>2019-08-13 15:49:47 -0400
commitf66905f36427aa7b066186d722a8af8d3e2c0275 (patch)
tree40cab23108da4a98291aa0d768fb729561ef15d8 /adopt.go
parente4839bdff00f09ccb4e0a8b12d634d26d172dfc9 (diff)
remove hardcoded paths
Diffstat (limited to 'adopt.go')
-rw-r--r--adopt.go10
1 files changed, 5 insertions, 5 deletions
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
}