diff options
author | Steve Manuel <nilslice@gmail.com> | 2016-12-19 13:43:10 -0800 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2016-12-19 13:43:10 -0800 |
commit | 3d6a3815d99af7b436ec0742204a1331012b5f2d (patch) | |
tree | e795a33e821d12bbebbe994b6500610b00e78a63 | |
parent | 8dc42e80b76e07c2b62c14fe464ebb9c7906bb4b (diff) |
adding possible fix for copying root directories into vendor unnecessarily
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | cmd/ponzu/main.go | 2 | ||||
-rw-r--r-- | cmd/ponzu/options.go | 25 |
3 files changed, 17 insertions, 12 deletions
@@ -8,7 +8,7 @@ $ go get github.com/ponzu-cms/ponzu/... ## Usage ``` -$ ponzu [specifiers] command <params> +$ ponzu [flags] command <params> Ponzu is a powerful and efficient open-source "Content-as-a-Service" system framework. It provides automatic, free, and secure HTTP/2 over TLS (certificates diff --git a/cmd/ponzu/main.go b/cmd/ponzu/main.go index ae646c5..13c4edd 100644 --- a/cmd/ponzu/main.go +++ b/cmd/ponzu/main.go @@ -23,7 +23,7 @@ import ( var year = fmt.Sprintf("%d", time.Now().Year()) var usageHeader = ` -$ ponzu [specifiers] command <params> +$ ponzu [flags] command <params> Ponzu is a powerful and efficient open-source "Content-as-a-Service" system framework. It provides automatic, free, and secure HTTP/2 over TLS (certificates diff --git a/cmd/ponzu/options.go b/cmd/ponzu/options.go index e1e432f..bb105ce 100644 --- a/cmd/ponzu/options.go +++ b/cmd/ponzu/options.go @@ -204,16 +204,8 @@ func copyFilesWarnConflicts(srcDir, dstDir string, conflicts []string) error { return err } - if info.IsDir() { - if len(path) > len(srcDir) { - path = path[len(srcDir)+1:] - } - dir := filepath.Join(dstDir, path) - err := os.MkdirAll(dir, os.ModeDir|os.ModePerm) - if err != nil { - return err - } - + // skip copy root directory + if path == srcDir { return nil } @@ -228,6 +220,19 @@ func copyFilesWarnConflicts(srcDir, dstDir string, conflicts []string) error { } } + if info.IsDir() { + if len(path) > len(srcDir) { + path = path[len(srcDir)+1:] + } + dir := filepath.Join(dstDir, path) + err := os.MkdirAll(dir, os.ModeDir|os.ModePerm) + if err != nil { + return err + } + + return nil + } + err = copyFile(path, dstDir) if err != nil { return err |