From 024dcc13733c55722cbd65a5fd9c42d63664f889 Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Sat, 17 Dec 2016 00:54:53 -0800 Subject: add debug for build step --- cmd/ponzu/options.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cmd') diff --git a/cmd/ponzu/options.go b/cmd/ponzu/options.go index 142302f..dc2a573 100644 --- a/cmd/ponzu/options.go +++ b/cmd/ponzu/options.go @@ -178,17 +178,22 @@ type copyPlan struct { func copyFile(info os.FileInfo, src string, dst string) error { dstFile, err := os.Create(filepath.Join(dst, info.Name())) + defer dstFile.Close() if err != nil { + fmt.Println("Error in os.Create", src, dst) return err } srcFile, err := os.Open(filepath.Join(src, info.Name())) + defer srcFile.Close() if err != nil { + fmt.Println("Error in os.Open", src, dst) return err } _, err = io.Copy(dstFile, srcFile) if err != nil { + fmt.Println("Error in io.Copy", src, dst) return err } @@ -205,7 +210,7 @@ func copyDirWithPlan(plan copyPlan) error { path := plan.srcPath if plan.ignoreRootDir { dirs := strings.Split(plan.srcPath, string(filepath.Separator))[1:] - filepath.Join(dirs...) + path = filepath.Join(dirs...) } dirPath := filepath.Join(path, info.Name()) -- cgit v1.2.3