copy sum too

This commit is contained in:
Mark Bates 2019-11-20 21:58:48 -05:00
parent 8f84b7462f
commit c83687a932
1 changed files with 15 additions and 22 deletions

View File

@ -68,12 +68,13 @@ func newRef(root string) (*Ref, error) {
return nil, err
}
b, err = ioutil.ReadFile(filepath.Join(root, "go.mod"))
for _, n := range []string{"go.mod", "go.sum"} {
b, err = ioutil.ReadFile(filepath.Join(root, n))
if err != nil {
return nil, err
}
f, err := os.Create(filepath.Join(dir, "go.mod"))
f, err := os.Create(filepath.Join(dir, n))
if err != nil {
return nil, err
}
@ -85,15 +86,7 @@ func newRef(root string) (*Ref, error) {
if err := f.Close(); err != nil {
return nil, err
}
// c := exec.Command("cp", "-rv", root, dir)
// fmt.Println(strings.Join(c.Args, " "))
// c.Stdout = os.Stdout
// c.Stderr = os.Stderr
// c.Stdin = os.Stdin
// if err := c.Run(); err != nil {
// return nil, err
// }
}
return ref, nil
}